This adds a new .kill(signal?) method to ShellPromise that allows users to terminate long-running shell processes.
Features:
- Kill processes with default SIGTERM (15)
- Accept numeric signal codes: .kill(9) for SIGKILL
- Accept named signals: .kill("SIGTERM") or .kill("TERM")
- Returns boolean indicating if any processes were killed
- Safe to call on processes that haven't started (returns false)
- Safe to call on processes that already exited (returns false)
- Properly handles pipelines by tracking all active subprocesses
Implementation:
- Added subprocess tracking to Interpreter via active_subprocesses list
- Added registerSubprocess/unregisterSubprocess methods
- Modified Cmd state to register/unregister subprocesses on spawn/cleanup
- Added JavaScript kill method with signal parsing and validation
- Added C++ binding for kill method in ShellInterpreter
- Added comprehensive test suite covering all use cases
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>