Skip to content

Fix terminal:open-*-dock commands ignoring their target location#32

Open
mjerem34 wants to merge 1 commit into
pulsar-edit:mainfrom
mjerem34:fix/open-dock-location-fallthrough
Open

Fix terminal:open-*-dock commands ignoring their target location#32
mjerem34 wants to merge 1 commit into
pulsar-edit:mainfrom
mjerem34:fix/open-dock-location-fallthrough

Conversation

@mjerem34

@mjerem34 mjerem34 commented Jun 1, 2026

Copy link
Copy Markdown

Summary

Terminal.openInCenterOrDock (src/terminal.ts) builds a location value with a switch, but none of the cases have break statements. Every case falls through to default, which resets location back to undefined. options.location is therefore never set, and open() falls back to getActiveWorkspaceLocation() (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-dock and terminal:open-center commands. The *-context-menu variants were already fine because they go through addDefaultPosition, which is consistent with what #27 reports.

Fixes #27.

Changes

  • Add the missing break statements in openInCenterOrDock (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

  1. Close the bottom dock.
  2. Run terminal:open-bottom-dock from the command palette.
  3. The terminal now opens in the bottom dock (previously it opened in the center, with the console logging {location: 'center'}).
  4. Repeat with 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.

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

terminal:open-*-dock commands defaulting to center

1 participant