Inherit cwd from source pane when splitting#66
Merged
Merged
Conversation
When a split is initiated from an existing pane, the new pane spawns with the source pane's last-known cwd. Remote cwds (e.g. OSC 7 over ssh) are skipped since they aren't usable as a local spawn directory. The inherited cwd rides through setPendingShellOpts alongside the inherited shell selection and is consumed by getOrCreateTerminal on the next platform.spawnPty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Extract `PendingShellOpts` interface in terminal-store so the
`{ shell?; args?; cwd? }` shape stops being repeated across the
store and the lifecycle module.
- Drop a stale narrative comment in Wall.tsx; tighten the remaining
one to explain why remote cwds are skipped.
- Hoist the duplicated `vi.stubGlobal` setup in
terminal-registry.alert.test.ts into shared
install/uninstallRegistryTestGlobals helpers so the new
pending-shell-opts describe block reuses the existing setup.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
996e0bc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://41024e5a.mouseterm.pages.dev |
| Branch Preview URL: | https://maintain-cwd.mouseterm.pages.dev |
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
"/%, header split buttons, or Cmd/Ctrl+Click on a split icon) spawn with the source pane's last-known cwd. Remote cwds (e.g. an OSC 7 path reported over ssh) are skipped because they aren't usable as a local spawn directory.setPendingShellOptsalongside the inherited shell selection and is consumed bygetOrCreateTerminalon the nextplatform.spawnPty.{ shell?; args?; cwd? }shape asPendingShellOptsand shares thevi.stubGlobalsetup between the two describe blocks interminal-registry.alert.test.ts.Test plan
pnpm -C lib test— 46/46 interminal-registry.alert.test.tspass, including the two new pending-shell-opts cases.pnpm -C lib exec tsc --noEmitclean.cdsomewhere, split it horizontally and vertically — confirm the new pane starts in the same directory.🤖 Generated with Claude Code