[BUG] Bash tool produces no output when KSH_OPTION_PRINT is set in ~/.zshrc

Status Open
Maintainer reply None cached
Activity 0 comments · opened Sep 23, 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?

When setopt KSH_OPTION_PRINT is present in ~/.zshrc, the Bash tool captures no output at all — not even from simple echo commands.

What Should Happen?

Claude Code sees output from a test script that contains only "echo hello, world".

Error Messages/Logs

> Run the hello.sh script and tell if you see output.

  Thought for 2s

Running the script now.

  Ran 1 shell command

The script ran successfully (exit code 0) but produced no output. Let me check what's in it.

  Thought for 3s, read 1 file

Interesting — the script contains echo "Hello, world!" so it should have printed output, but nothing appeared. Let me investigate.

  Thought for 2s, ran 2 shell commands

Every command is returning no visible output, including a plain echo. This appears to be an environment issue where stdout is being suppressed — it's not specific to your script. The script itself looks correct (echo "Hello, world!"), but I'm unable to see any output from any Bash command in this session.

Steps to Reproduce

  1. Test with user how has zsh configured as their shell
  2. Add setopt KSH_OPTION_PRINT to ~/.zshrc
  3. Restart Claude Code
  4. Run any command via the Bash tool, e.g. echo "Hello, world!"
  5. Observe: tool reports no output

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Code v2.1.280

Platform

Google Vertex AI

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

Removing "setopt KSH_OPTION_PRINT" make Claude Code work as expected again.

View original on GitHub ↗