Conversation
Minimizing the last terminal in a Workspace auto-spawns a replacement; it now inherits the minimized Surface's local cwd, as a split does. The local-cwd derivation shared by splits, dor split/ensure, and the refill moves into one helper. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A kill disposes the Session's state before removing the leaf, so the cwd is read first and handed to the refill across the removal commit, the same way minimize hands it across doorLeaf. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The store subscription already knows which leaf a tree-emptying commit took, so the refill reads that pane's cwd itself; a kill now disposes the Session after removing its leaf so the state is still there to read. This drops the ref handed across both commits. The local-cwd rule moves into the terminal state store, shared with Helper terminals, and the default-shell staging the refill and both split paths repeated becomes one helper. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
86f6329
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d9e529af.mouseterm.pages.dev |
| Branch Preview URL: | https://preserve-dir.mouseterm.pages.dev |
dormouse-bot
left a comment
There was a problem hiding this comment.
Feedback on work in progress, not a merge verdict — marking the PR ready requests the full review.
docs/specs/layout.md → "Split cwd inheritance" now names a read that no longer happens. That paragraph says the source cwd is read from getTerminalPaneState(sourceId).cwd and then states the never-inherit-a-remote-cwd rule; both moved into getInheritableCwd, which reads paneStates directly and is now the single owner of that rule across all four split sites plus the refill. Per AGENTS.md → "Specs" ("When code covered by a spec changes, change the spec"), the sentence should name getInheritableCwd in lib/src/lib/terminal-state-store.ts instead. The substitution is word-neutral, so layout.md's budget is unaffected. The line sits outside this diff's hunks, so it is prose here rather than a suggestion — I can push the edit once the PR is out of draft if you'd rather not hand-apply it.
One more point inline, on helper-terminal.ts.
The Helper's spawn already dropped a remote parent cwd, but the launched command's record still took the unfiltered ssh path, so the helper claimed a local cwd it was not in. Both now use the same inheritable cwd. The layout spec names getInheritableCwd as the split's cwd read. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Review-body finding fixed in 86f6329: |
|
Both confirmed against 86f6329 — thanks. The spec line now names On the helper: worth recording where the remote case lands downstream, since that was the concern behind the finding. I did not run the suite locally; |
When the last pane in a Workspace is killed or minimized, the auto-spawned replacement now starts in that pane's local cwd, the same way a split does. It used to start in the shell's default directory.
lib/src/components/Wall.tsx): the store subscription already diffs leaf ids, so a commit that empties the tree hands the departed id torefillEmptyTree, which reads that pane's cwd. A remote cwd (OSC 7 over ssh) is not inherited.removeLeaf, so the pane state holding the cwd is still there when the refill reads it. The subscribers that run synchronously on that commit are the Wall's own effect, a timer-scheduled persistence save, andawaitWallEmpty(which resolves through a promise); none of them reads the departed Session.getInheritableCwd(id)interminal-state-store.tsreplaces the four inline copies of the local-cwd rule (manual split,dor split/ensure, Helper terminals, refill);stageDefaultShellinWall.tsxreplaces the three copies of the default-shell staging.docs/specs/layout.md→ "Auto-spawn refill".Test:
Wall.test.tsx→ "starts the refill after Minimize/Kill of the last pane in that pane's cwd". The Kill case fails if the old dispose-before-remove order comes back.🤖 Generated with Claude Code