Repository navigation
perf(terminal): a clean WSL bridge exit skips the boot-id read - #35138
Merged
Merged
Conversation
On awin a wsl --terminate exited each bridge pane with -1, while exit and exit 0 gave 0, so a terminate never yields 0. A clean exit keeps today's verdict without the extra wsl.exe spawn. Co-Authored-By: Claude <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6 of 7 tasks
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.
ELI5
When you type
exitin a WSL terminal opened from a\\wsl.localhost\…project, Orca checks whether the distro was restarted before closing the tab. Part of that check runs an extrawsl.exe(0.2–1 s, at most 5 s). A cleanexitcan't come from the distro being shut down, so Orca now skips that extra step for it, and the tab closes sooner.What Changed
exit.0skips the boot-id read. Its verdict is the same as before that read existed: a normal exit, and the tab closes. A non-zero exit code still gets the full check.DaemonPtyAdapter.finishWslBridgeExitpassesclassifyWslBridgeExita reboot check that answers "no" at once whenexit.code === 0. The running-list check is unchanged. The verdict log line still names the code.Why
wsl --terminateexited both open bridge panes with code -1.exitandexit 0gave 0, andexit 3gave 3.wsl.exespawn from every normalexit, which is the common case. fix(terminal): a WSL bridge pane keeps its session when its distro is booted again before the check #35050's PR text set out exactly this condition for adding the skip, and fix(terminal): a WSL bridge pane keeps its session when its distro is booted again before the check #35050 added the exit code to the verdict log so it could be verified.exit 1after a failing command, or an unexpected code from a terminate, are still checked.Flag-off: not behind the WSL hosts gate. This is WSL bridge-pane behaviour, the same with the gate on or off. Native, SSH and hosted-WSL panes are unaffected.
User risk: very low. A clean exit gets today's pre-#35050 verdict, a normal exit, with one less process spawn. If a future WSL version ever exited a terminated pane with 0, that pane would close as before #35050 rather than being kept.
Linked Issue
Follow-up to #35050 (latency from reviewer A; exit-code evidence from awin).
Visual Proof
N/A.
Testing
daemon-pty-adapter-wsl-distro-loss.test.ts: a code-0 exit stays a normal exit even when the boot id changed, and reads the boot id only once, at spawn. The test fails without the skip.pnpm tc:node,oxlint,pnpm run check:code-quality:changedand the ast-grep gate pass.src/main/daemon: 3,139 passed.AI Disclosure
Written with Claude Code.
Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)