-
Notifications
You must be signed in to change notification settings - Fork 212
fix(terminal): use detected shell for execa and vscode terminal creation (#321) #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 7 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1801e0a
fix(terminal): use detected shell for execa and vscode terminal creat…
44c6e00
test(terminal): update ExecaTerminalProcess tests for getShell() inte…
F915 dc4a451
Merge branch 'main' into main
F915 9205427
test(terminal): strengthen fallback assertions with getShell() mock
e9dcb02
Merge branch 'Zoo-Code-Org:main' into main
F915 3ae0a88
test(terminal): fix TerminalRegistry.spec.ts CI failures after getShe…
F915 3ed991e
Merge branch 'Zoo-Code-Org:main' into main
F915 387ca89
fix(terminal): delegate shell detection to vscode.env.shell (#321)
F915 55f901c
Merge branch 'main' into main
F915 87cbfe7
fix(shell): resolve upstream merge conflicts and rename Roo Code to Z…
F915 b871106
Merge branch 'main' into main
F915 35ef0a6
fix(terminal): harden abort guard, add WSL UNC path conversion, and i…
F915 f1e065d
fix(terminal): merge upstream terminal profile override (#277) with s…
F915 5ffed42
fix(terminal): address code review minor issues from merge #333
F915 34458d3
Merge remote-tracking branch 'upstream/main'
F915 0a3f847
Merge upstream/main — sync to v3.58.0
F915 8893d0b
Merge branch 'Zoo-Code-Org:main' into main
F915 28b96ac
fix(terminal): harden shell detection, WSL support, and error recover…
F915 dcd026a
fix: harden ZDOTDIR guard, PowerShell detection, abort handling, and …
F915 81653a6
chore: restore .husky and .roo files accidentally dropped during upst…
F915 ad21186
perf(terminal): cache wslpath conversions to avoid redundant wsl.exe …
F915 7473874
fix(terminal): kill WSL process group from inside Linux on abort (#321)
F915 bc672d0
test(e2e): add shell integration regression guard with SI capability …
F915 b564140
fix(test): suppress require-yield lint warning in abort test generator
F915 1eed734
fix(terminal): clear profile override when Inline Terminal is enabled…
F915 b921c41
Merge branch 'main' into main
F915 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user has WSL configured but no explicit shell path,
getShell()returns/bin/bash(a Unix path) — does passing that asshellPathactually work on Windows, or wouldwsl.exebe needed here?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, and you're right that this was a real issue.
After further analysis, we've addressed this in the follow-up refactoring (commit 387ca89). The terminal constructor now checks for WSL configuration first — when WSL is detected,
shellPathis omitted so VS Code's own WSL profile handles shell selection. Passing an explicit shell path would bypass VS Code's profile system.With this fix, the inline terminal path can now correctly execute WSL commands. However, the external terminal path still cannot work with WSL, because VS Code shell integration does not support WSL — the supported shells on Windows are limited to Git Bash and pwsh. In practice, the external terminal will wait for shell integration until timeout, then fall back to the inline terminal — which is the expected behavior.
These changes are part of a broader consolidation of shell detection that the WSL issue prompted us to revisit. The upstream code manually parsed VS Code's terminal profile configuration with a shell allowlist, but this approach was inherently fragile — it could not reliably match VS Code's internal shell resolution, which is exactly the kind of mismatch your comment pointed out. To address this at the root, we removed the allowlist and manual parsing in favor of
vscode.env.shell, the API VS Code has provided for this purpose. As a result, the two command execution paths now share the same shell resolution logic, so there is no longer a risk of falling back to a different shell than the one the external terminal used. A safety check that guarded against this mismatch — but relied on the same fragile detection it was meant to protect against — became redundant and was removed.We also removed a
sendTextcall that previously fired before the fallback when shell integration was unavailable — this could cause the command to execute in the external terminal without output capture, and then again via the inline path, resulting in unintended double execution. The fallback to the inline terminal now happens directly.Thanks again for taking the time to review — the feedback was helpful in tracing this issue to its root cause.