Skip to content

Conversation

@knowsuchagency
Copy link

Summary

Fixes #1104

This PR updates the shell selection logic to respect the user's default shell from the SHELL environment variable instead of hardcoding a preference for zsh over bash.

Changes

  • Modified get_shell_command() in crates/utils/src/shell.rs to:
    1. Check the SHELL environment variable first
    2. Extract and validate the shell name from the path
    3. Support common shells: bash, zsh, fish, ksh, dash, sh
    4. Fall back to bash → sh if SHELL is not set or contains an unknown shell
    5. Removed hardcoded zsh preference over bash

Testing

  • All 112 workspace tests pass
  • Code formatting verified with cargo fmt --check
  • Linting passes with cargo clippy --all --all-targets --all-features -- -D warnings

Behavior

Before: Always prefers zsh if installed, regardless of user's default shell
After: Uses the shell specified in SHELL env var, falls back to bash/sh if not set

Previously, the shell selection logic hardcoded a preference for zsh over bash,
ignoring the user's configured default shell. This changes the behavior to:

1. Check the SHELL environment variable first
2. Validate the shell exists and is supported
3. Fall back to bash or sh if SHELL is not set or invalid

This ensures consistent shell behavior across the system and respects user preferences.
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.

Shell selection ignores user's default shell

1 participant