You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Phase 0 Sealing - SIGINT handling for external commands
Implemented graceful Ctrl+C handling that interrupts running external
commands without killing the shell:
Changes:
- Added ctrlc = "3.4" dependency for cross-platform signal handling
- Added INTERRUPT_REQUESTED global AtomicBool flag in main.rs
- Installed SIGINT handler in repl::run() to set interrupt flag
- Updated execute_external() to use .spawn() + polling loop
- Updated execute_external_with_redirects() with same pattern
- Added process group management on Unix for proper job control
Behavior:
- External commands now check interrupt flag every 50ms
- Ctrl+C kills child process and returns exit code 130 (128 + SIGINT)
- Shell continues running after interrupt
- No zombie processes left behind
Files changed:
- Cargo.toml: Added ctrlc dependency
- src/main.rs: Added INTERRUPT_REQUESTED static
- src/external.rs: Changed .status() → .spawn() + try_wait() loop
- src/repl.rs: Installed signal handler at REPL start
- tests/manual_sigint_test.sh: Manual verification script
Test results: 90/90 passing (no regressions)
Phase 0 Sealing: Component 1/6 complete
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0 commit comments