[BUG] all bash script are in bash format, if user default shell is not bash will result in error

Resolved 💬 8 comments Opened Sep 12, 2025 by 424778940z Closed Jan 10, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

bash is forced when calling bash script on linux which is fine, but if user default shell is not bash (let's say zsh), claude code will try run bash script in zsh, and result in error

before recent update, there is a workaround to set SHELL env in ~/.claude/settings.json, but some how recently no longer works, thus claude code won't be able to run any bash command at all, which break the basic function

What Should Happen?

it should just run shell command properly

if I use SHELL=/usr/bin/bash claude, it will work fine, but that is not reall acceptable workaround, it should be fixed properly, either be compatible with other shell, or give me an arg, or respect my local user wide settings.json

Error Messages/Logs

● Bash(env -i PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/bash -c "ninja -C .build 2>&1 | head -50")
  ⎿  Error: /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5463: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5464: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5465: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5466: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5467: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5468: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5469: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5470: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5471: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5472: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5473: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5474: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5475: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5476: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5477: no such option: on
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5478: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5479: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5480: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5481: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5482: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5483: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5484: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5485: no such option: on
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5486: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5487: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5488: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5489: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5490: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5491: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5492: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5493: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5494: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5495: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5496: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5497: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5498: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5499: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5500: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5501: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5502: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5503: no such option: on
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5504: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5505: no such option: on
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5506: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5507: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5508: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5509: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5510: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5511: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5512: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5513: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5514: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5515: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5516: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5517: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5518: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5519: no such option: off
     /home/localuser/.claude/shell-snapshots/snapshot-zsh-1757661777231-0gwu4i.sh:setopt:5520: no such option: off

Steps to Reproduce

  1. open claude under zsh
  2. "run a simple bash echo command"
  3. you get the error

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

1.0.112

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗