claude-code
claude-code copied to clipboard
Crash: EPERM error when killing background shell process
Description
Claude Code crashed with an EPERM (permission error) when attempting to kill a background shell process.
Error Details
Error: kill EPERM
at process.kill (node:internal/process/per_thread:281:13)
at PM0 (file:///home/jot/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@anthropic-ai/claude-code/cli.js:195:2928)
at file:///home/jot/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@anthropic-ai/claude-code/cli.js:195:2801
at Array.forEach (<anonymous>)
at file:///home/jot/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@anthropic-ai/claude-code/cli.js:195:2772
at Array.forEach (<anonymous>)
at TM0 (file:///home/jot/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@anthropic-ai/claude-code/cli.js:195:2744)
at file:///home/jot/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@anthropic-ai/claude-code/cli.js:195:2675
Context
The crash occurred after:
- Running a background bash command:
sudo libinput debug-events --show-keycodes 2>&1 | head -50 - Attempting to kill the background shell using the Kill Shell tool
Environment
- Claude Code version: 2.0.29
- Platform: Linux (Fedora 43)
- Kernel: 6.17.11-300.fc43.x86_64
- Installation method: pnpm global
Steps to Reproduce
- Run a background bash command with sudo
- Attempt to kill the background shell process
- Observe EPERM error and crash
Expected Behavior
Claude Code should handle permission errors gracefully when attempting to kill background processes, rather than crashing.