Repository navigation
fix(terminal): a WSL pane a relaunched window reattached keeps its folder when slept - #33496
Conversation
…lder when slept After an app relaunch, the window reattaches a live pane without its spawn environment, so the daemon client never learned the pane's ORCA_PANE_KEY. Sleep then skipped the folder read for it, and the pane woke at its spawn folder. A move's kill-at-quiesced rollback also put a pane `cd`'d before the relaunch back at the project root (awin verify-11, 5e). Sleep now takes the pane key from the daemon's session list when it knows the session's distro but not its key. That is the same one `listSessions` the adoption of an unattached session already uses. Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
ELI5
On Windows, restart Orca, click back into a WSL terminal you had
cd'd somewhere, then put its workspace to sleep. On waking, it opened at the workspace root instead of where you were. Now it keeps the folder.What Changed
Before:
ORCA_PANE_KEY.quiescedrollback: the terminal came back at the project root.After: Sleep keeps the folder for reattached terminals too.
Mechanism:
listSessionscall when, on Windows, the client knows the session's WSL distro but not its pane key.Why
The daemon already keeps the spawn pane key for each session, so asking it once at Sleep is exact. The alternative was passing the key through every reattach path in the window and runtime, which is a much wider change for the same answer.
Linked Issue
Follow-up to #33398 and #33425, from a Windows/WSL verification run (5e: kill at
quiescedrolled acd'd pane back to the root).Visual Proof
N/A: main-process daemon client, no UI change. The test below reproduces the relaunch, reattach and Sleep path.
Testing
New case in
daemon-pty-adapter-wsl-sleep-cwd.test.ts:attach()es it (no spawn environment) and sleeps it.…\deep\er.mainbefore this change.The seed-failure regression test (fix(terminal): a pane a relaunched app has not reopened keeps its history and folder when slept #33425) and the other folder cases still pass.
pnpm tc:node,check:code-quality:changedandrun-ratchets.mjspass.In
src/main/daemon, the only failures are the real-shell shell-ready tests, which also fail on cleanmainhere.daemon-pty-adapter-history-recoveryfailed once under load and passes twice alone.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
listSessionsper Sleep of such a session.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code