Repository navigation
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — This changes the default startup behavior of every macOS Bash integrated terminal by adding the You can add or adjust custom eligibility rules. Learn more. |
|
Warning Review limit reachedOnly developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing. Next included review available in 1 minute. View limit details
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
The integrated terminal launched bash with no arguments, so on macOS it never read ~/.bash_profile. Terminal.app and VS Code start bash as a login shell, which is where macOS users keep their prompt and functions. Pass -l when the host is macOS and the shell is bash. Linux, Windows and other shells are unchanged. Fixes pingdotgg#22250
29e0d90 to
74518c8
Compare
|
Note Written by updated the original branch at verification:
unverified this run: real macos bash profile loading, electron, and the client terminal interaction. this vm is linux, so no macos before/after capture is claimed. the original author's macos verification remains in the description. the change applies on the server host, including remotely connected clients; linux/windows and other shell arguments are covered by the regression matrix. ready for maria's review. the existing human-approval note remains for her decision. |
Closes #22250
Problem
On macOS, the integrated terminal starts Bash as a plain interactive shell (
/bin/bashwith no arguments), so~/.bash_profileis never read. Users who keep their prompt and functions there get the barebash-3.2$prompt. Terminal.app and VS Code start Bash as a login shell, so the same setup works there.Change
apps/server/src/terminal/Manager.ts:shellCandidateFromCommandalready passes-NoLogoto PowerShell on Windows and-o nopromptspto zsh on non-Windows hosts, but Bash fell through with no args. It now returnsargs: ["-l"]when the host isdarwinand the shell isbash. The/bin/bashandbashfallback candidates go through the same function, so they get-ltoo. Linux, Windows and other shells are unchanged.Scope and approval
#22250 is not triaged yet. It qualifies as a very small, focused fix of an obvious bug: one platform/shell branch in
shellCandidateFromCommand, next to the existing zsh and PowerShell cases, plus one test. It matches what macOS terminals already do and doesn't touch Linux or Windows.Verification
New test in
Manager.test.ts, "starts bash as a login shell on macOS only", driven throughmanager.openwith the host platform overridden. Cases: darwin/bin/bashand/opt/homebrew/bin/bashget["-l"]; linux/bin/bashand win32bash.exeget no args; zsh on darwin and linux and win32pwsh.exekeep their current args.mainwithout the fix: the two darwin Bash cases fail (expected undefined to deeply equal [ '-l' ]), the other five pass.Manager.test.tsandNodePtyAdapter.test.tspass, 53/53 (rebased onto main after test: delete 11k low-signal tests so CI runs faster and flakes less #22557, test(server): ban real-clock waits in tests #22564 and test(server): prune low-value tests in apps/server (second pass) #22592, which trimmed these files).vp fmt --checkis clean,vp lintonapps/serverand the server typecheck report no errors.Manual check on macOS (Apple Silicon) with an isolated dev instance (server + web) and a temp
HOMEwhose.bash_profilesetsT3_LOGIN_PROFILE_LOADED=yes, opening the terminal with Cmd+J:login_shellunset/bin/bashyes/bin/bash -lNot checked: the packaged Electron app (same server code path) and Intel Macs (same
darwincheck).Claude Sonnet 5.5 (xhigh) via T3 Code.