Skip to content

fix: prefer the macOS login shell for new sessions#4

Open
samwei12 wants to merge 1 commit intocloudcli-ai:mainfrom
samwei12:fix/macos-login-shell-default
Open

fix: prefer the macOS login shell for new sessions#4
samwei12 wants to merge 1 commit intocloudcli-ai:mainfrom
samwei12:fix/macos-login-shell-default

Conversation

@samwei12
Copy link
Copy Markdown

Summary

Fixes the macOS case where new terminal sessions start in bash even when the user's real login shell is zsh.

Closes #2.

Root cause

The plugin currently resolves the shell from process.env.SHELL || '/bin/bash'.

CloudCLI starts plugin backend processes with a deliberately restricted environment and does not pass through SHELL, which appears intentional and should stay that way for safety. For the terminal plugin specifically, that causes a fallback to /bin/bash on macOS even when the real login shell is zsh.

What changed

  • only on darwin, if process.env.SHELL is missing or still /bin/bash, fall back to os.userInfo().shell
  • preserve existing behavior on Windows
  • preserve existing process.env.SHELL behavior on non-macOS platforms
  • pass the resolved shell into the PTY child env as SHELL so the shell session is internally consistent

Verification

  • npm run build
  • validated darwin stale-bash fallback to /bin/zsh
  • validated explicit env shell remains respected
  • validated non-darwin keeps existing behavior
  • validated fallback to env.SHELL || /bin/bash when os.userInfo() is unavailable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New macOS terminal sessions default to bash instead of the user's login shell

1 participant