fix(cli): re-raise the actual terminating signal, not always SIGINT

main

Commit

toothbrush2mo ago

Addresses PR review: the handler also catches SIGTERM on non-Windows, but the exit path unconditionally re-raised SIGINT and printed a "press Ctrl-C again" hint. A SIGTERM shutdown (supervisor / container stop) would exit 130 instead of the conventional 143 and show a misleading message.

Capture which signal fired, re-raise that same signal (SIGINT→130, SIGTERM→143 via 128+signum), and tailor the first-signal message.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 3ef3536ec8b3

Checkpoints

Fix Ctrl-C Signal Handling in CLI

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1