Fix terminal:open-*-dock commands ignoring their target location#32
Open
mjerem34 wants to merge 1 commit into
Open
Fix terminal:open-*-dock commands ignoring their target location#32mjerem34 wants to merge 1 commit into
mjerem34 wants to merge 1 commit into
Conversation
The switch in `openInCenterOrDock` had no `break` statements, so every case fell through to `default` and reset `location` back to `undefined`. `open()` then fell back to the active pane container, so the terminal opened in the center instead of the requested dock. Add the missing `break` statements so `terminal:open-bottom-dock`, `open-left-dock`, `open-right-dock` and `open-center` resolve to their intended location. Fixes pulsar-edit#27. Generated with AI assistance (Claude Opus 4.8 Max).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Terminal.openInCenterOrDock(src/terminal.ts) builds alocationvalue with aswitch, but none of the cases havebreakstatements. Every case falls through todefault, which resetslocationback toundefined.options.locationis therefore never set, andopen()falls back togetActiveWorkspaceLocation()(the active pane container) — so the terminal opens in the center instead of the requested dock.This fixes the
terminal:open-bottom-dock,terminal:open-left-dock,terminal:open-right-dockandterminal:open-centercommands. The*-context-menuvariants were already fine because they go throughaddDefaultPosition, which is consistent with what #27 reports.Fixes #27.
Changes
breakstatements inopenInCenterOrDock(src/terminal.ts).lib/is intentionally left untouched: the build output appears to be committed only at release time (prepublishOnly), and recent source-only commits don't include it.How to test
terminal:open-bottom-dockfrom the command palette.{location: 'center'}).terminal:open-left-dock/terminal:open-right-dock.Disclosure
This change was generated with AI assistance (Claude Opus 4.8 Max) and reviewed before submitting. I fully understand if you'd prefer not to accept an AI-assisted contribution — feel free to close it; the root cause is documented above and in #27 regardless.