Skip to content

[BUG] Bash mode does not execute commands in Bash #2902

Closed as duplicate
Closed as duplicate

Description

@Domon

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • Claude CLI version: 1.0.41 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: fish shell with iTem 2

Bug Description

The ! command trigger in Claude Code always uses /bin/zsh for command execution, even though:

  1. The user's shell is fish (or bash);
  2. Claude Code was launched from fish (or bash);
  3. ! is called "Bash mode" in the shortcuts.
Image Image

Steps to Reproduce

  1. Set fish (or bash) as the default shell: chsh -s /opt/homebrew/bin/fish
  2. Launch Claude Code from fish (or bash): claude
  3. Use any ! command, e.g., !echo $SHELL or !echo $0
  4. Observe that the output is /bin/zsh and commands are executed in zsh.
Image

p.s. The same occurs with the Bash tool.

Image

Expected Behavior

The ! command should execute commands in either Bash as it claims or the shell from which Claude Code was launched.

Actual Behavior

  • Commands are always executed using /bin/zsh
  • The SHELL environment variable is set to /bin/zsh within Claude Code
  • Shell-specific features and configurations from fish are not available

Additional Context

Activity

  1. added
    bugSomething isn't working
    on Jul 3, 2025
  2. github-actions commented on Aug 16, 2025

    @github-actions

    Found 2 possible duplicate issues:

    1. Bash tool misleadingly executes in user's default shell instead of actual bash #2444
    2. [BUG] Bash tool fails with zsh + zoxide configuration - "__zoxide_z not found" errors #2632

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. added
    duplicateThis issue or pull request already exists
    and removed
    bugSomething isn't working
    has reproHas detailed reproduction steps
    platform:macosIssue specifically occurs on macOS
    on Aug 20, 2025
  4. github-actions commented on Aug 20, 2025

    @github-actions

    This issue has been automatically closed as a duplicate of #2444.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  5. github-actions commented on Aug 27, 2025

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  6. locked as resolved and limited conversation to collaborators on Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions