[Bug] Bash tool doesn't capture stdout from subprocess script execution

Resolved 💬 3 comments Opened Jan 26, 2026 by ilepn Closed Jan 26, 2026

Bug Description

When executing bash scripts as subprocesses (./script.sh or bash script.sh), stdout is not captured. However, other execution methods work correctly.

Programmatic Proof

Working methods:

  • Direct command: echo "test" → outputs "test" ✓
  • Inline bash: bash -c 'echo "test"' → outputs "test" ✓
  • Source: source script.sh → outputs correctly ✓

Failing methods:

  • Script execution: ./script.sh → no output ✗
  • Bash script: bash script.sh → no output ✗

Test Case

# Create test script
echo '#!/bin/bash
echo "Hello from script"' > /tmp/test.sh
chmod +x /tmp/test.sh

# These produce no output in Claude Code:
/tmp/test.sh
bash /tmp/test.sh

# These work:
source /tmp/test.sh
bash -c 'echo "Hello inline"'

Impact

  • Breaks tools with bash wrapper scripts (e.g., gsudo on Windows)
  • Silent failures make debugging difficult

Environment

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.19

Workaround

Use source or define shell functions instead of script execution.

---
Feedback ID: 7ee3ac50-c773-48db-aacc-b11d8dcfc478

View original on GitHub ↗

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