[Bug] Windows: killing background Bash task leaves pyenv-win python.exe orphaned, output file grows unbounded
Status Open
Reported on v2.1.293
Maintainer reply None cached
Activity 1 comment · opened Oct 12, 2026
Windows: stopping a background Bash task doesn't kill a process started via .bat, so the task output grew to 143 GB
Environment: Windows 11, Claude Code 2.1.293, Git Bash, Python 3.14.4 via pyenv-win.
What happened:
- The Bash tool ran
python -I - <<'EOF'with an empty heredoc. After 120 s the command was moved to the background (task bnpwzwi1k). - On Windows, Python 3.14 treats stdin=NUL as a TTY. It starts _pyrepl, which loops printing a traceback (~2 MB/s) into tasks\<id>.output.
- Claude Code marked the task "killed" (2026-10-09 15:56). The python.exe process kept running for ~40 h until the disk filled up. The output file reached 143 GB.
Why it was orphaned: the pyenv-win shim starts python via cmd.exe /C pyenv.bat exec python. That process ends up outside bash's process tree, so killing the bash tree doesn't reach it. With a direct path to python.exe, taskkill /T kills it correctly (verified).
Expected:
- Stopping a task kills all child processes, e.g. via a Job Object with KILL_ON_JOB_CLOSE instead of walking the PID tree.
- A size limit on tasks\*.output, or a warning when it keeps growing.
Repro: in Git Bash with pyenv-win, run python -I - <<'EOF' + newline EOF, then kill bash. python.exe stays alive and keeps writing.
Environment Info
- Platform: win32
- Terminal: Orca
- Version: 2.1.293
- Feedback ID: addd589f-f9ae-48f0-9c73-95a5eede47e3
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗