Uh oh!
There was an error while loading. Please reload this page.
feat(terminal): let users choose their default shell - #6125
feat(terminal): let users choose their default shell#6125simon-curtis wants to merge 10 commits into
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a user-facing default-shell setting spanning contracts, settings UI, live server configuration, and terminal process spawning, including platform-specific path resolution and fallback behavior. That is a significant runtime capability change rather than a small isolated tweak, so the terminal/settings integration warrants human review. You can add or adjust custom eligibility rules. Learn more. |
5386fd9 to
0c17f61CompareUh oh!
There was an error while loading. Please reload this page.
CDVolvik
left a comment
There was a problem hiding this comment.
Windows-shaped tests on the PR files against current main: Manager.test.ts + settings.test.ts 89/89.
What I care about here:
- subscribe-to-settings before
getSettings(test pins the order) resolveCommandPath+PATHEXTsojzfindsjz.EXE- quoted
"C:\Program Files\…\bash.exe"is unwrapped before spawn - session
PATHwins over the process PATH when both have the same name
Empty default + trim is in the contract tests. Fallback to built-in PowerShell remains.
Small mismatch: the Electron placeholder is pwsh.exe. #6260 is the other open Windows-shell PR, and it prefers 5.1 (powershell.exe) over optional pwsh. The placeholder will nudge people at the one this repo is trying to stop probing first.
MERGEABLE. I did not open a real terminal session.
0c17f61 to
137463cCompareReview update pushed in
Verification: focused terminal/settings suites 88/88, targeted lint passed, and the I also checked related open PRs. #5268 and #6073 are alternative shell-selection implementations; #6260 overlaps the Windows fallback ordering; #6338 and #4827 touch the same terminal-start block. I kept those separate so this PR remains one shell-agnostic concern against current |
Uh oh!
There was an error while loading. Please reload this page.
cf76f21 to
b972c06CompareUh oh!
There was an error while loading. Please reload this page.
b972c06 to
e311827CompareUh oh!
There was an error while loading. Please reload this page.
2d9605b to
03ad822CompareThere was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 03ad822e19b29ed3a68e615a659271e24d0f2fef. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
9e38f97 to
8772631CompareUh oh!
There was an error while loading. Please reload this page.
1a8d434 to
4189825Compare4189825 to
4bb5d7dComparet3dotgg
commented
Aug 28, 2026
Note 🤖 GPT-5.6 Sol responding on behalf of Theo We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together. #5268 is the retained default shell implementation and limits choices to installed shells reported by the host. This branch accepts arbitrary command text and adds a larger cross-platform parsing contract that we do not need. If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed. |

What Changed
Terminal sessions always chose their shell implicitly, so users who preferred PowerShell, Git Bash, WSL, or another shell could not make it the default.
Settings now includes a Default terminal shell field. New terminal sessions read the current setting, preserve Windows executable paths whether quoted or unquoted, extract executable tokens from POSIX shell command lines, resolve bare Windows commands against the session environment, and retain the existing fallback candidates when the configured command cannot be started.
Why
A coding environment's terminal should open the shell the user actually works in. Making the choice explicit removes platform-dependent surprises while preserving safe fallback behavior and applying setting changes without restarting the server.
Verification
t3; prior checks also passed for@t3tools/weband@t3tools/contracts.UI Changes
Settings gains a Default terminal shell field. Before/after screenshots are not available from this environment.
Checklist
model: gpt-5.6-sol
harness: Codex in T3 Code
Note
Medium Risk
Changes which executable starts PTY sessions and adds Windows PATH resolution per session env; misconfiguration or PATH overrides could pick unexpected shells, though fallbacks remain.
Overview
Adds a Default terminal shell setting (
defaultTerminalShell, empty = platform default) in server settings and General settings UI, with search/reset support.TerminalManager now wires in
ServerSettingsService, subscribes to settings changes before reading the initial value, and uses the live value when spawning new sessions (no server restart). Shell resolution is tightened:~expansion, quoted executable extraction on POSIX,-NoLogofor Windowspwsh/powershell(including bare aliases), and PATH/PATHEXT lookup for bare Windows command names against each session’s spawn environment—while keeping existing fallback candidates when spawn fails. The terminal layer is providedServerSettingsLayerLiveinserver.ts.Contracts decode patches with trimmed strings; tests cover subscription ordering and the new resolution paths.
Reviewed by Cursor Bugbot for commit 4bb5d7d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add configurable default terminal shell setting with live updates
defaultTerminalShell(TrimmedString, defaults to"") inServerSettingsandServerSettingsPatchin settings.tsTerminalManagernow subscribes toServerSettingsService, reads the initial configured shell, and spawns a scoped fiber to keep the localconfiguredShellin sync as settings change; shell resolution runs against each session's effective environment instead of the base envnormalizeShellCommandexpands home-relative paths and handles quoted executables; on Windows,shellCandidateFromCommandappends-NoLogotopwsh/powershell, andresolveShellCandidatesresolves bare command names against effective PATH (with PATHEXT) viaresolveCommandPathDraftInputfor the setting inGeneralSettingsPanel, includes it inuseSettingsRestorereset logic, and registers a search entry insettingsSearch.tsresolveShellCandidatesnow requiresFileSystemandPathservices and performs PATH lookups on Windows before spawning; misconfigured PATH per-session env can change which executable is selected, and bare names previously spawned without PATH resolutionMacroscope summarized 4bb5d7d.