Skip to content

fix(alias): report an alias child killed by a signal other than INT/TERM - #4523

Merged
max-sixty merged 1 commit into
mainfrom
fix/alias-signal-diagnostic
Oct 20, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/alias-signal-diagnostic

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Since v0.80.0, an alias whose child dies by a signal other than SIGINT/SIGTERM (for example crash = "kill -KILL $$", or a segfaulting program) exits 128+N with no output. v0.80.0 printed ✗ Killed by signal N. #4352 and #4400 limited interrupt classification to SIGINT/SIGTERM, so these deaths now reach alias_error_wrapper, which turns every child exit code into a silent AlreadyDisplayed. wt exits normally rather than dying by the signal, so the shell reports nothing either.

alias_error_wrapper now maps a child exit with a physical signal to WorktrunkError::Interrupted, the variant custom subcommands (wt-foo) already use for the same case. It renders Killed by signal N and exits 128+N. SIGINT and SIGTERM still short-circuit earlier and are re-raised for the shell to report, as AGENTS.md "Signal Handling" specifies, so kill -TERM $$ stays silent from wt. Hooks and wt step for-each already report the signal in their own failure lines and are unchanged.

Verified with the release-review repros: SEGV and KILL aliases print ✗ Killed by signal 11 / 9 and exit 139 / 137, matching v0.80.0, for single, multi-step and concurrent aliases; exit 2 stays silent. The new unix-only test_step_alias_killed_by_signal snapshot fails without the fix.

This was written by Claude Code on behalf of max-sixty

v0.80.0 printed "✗ Killed by signal N" when an alias child died by a
signal such as SIGSEGV or SIGKILL. Since #4352 and #4400, interrupt
classification is limited to SIGINT/SIGTERM, so these deaths reach
alias_error_wrapper, which turns every child exit code into a silent
AlreadyDisplayed. wt exits 128+N without dying by the signal, so the
shell prints nothing either and the crash goes unreported.

alias_error_wrapper now maps a child exit with a physical signal to
WorktrunkError::Interrupted, the variant custom subcommands already use
for the same case, which renders "Killed by signal N" and exits 128+N.
SIGINT and SIGTERM still short-circuit in handle_command_error and are
re-raised for the shell to report, as AGENTS.md "Signal Handling"
specifies. Hooks and wt step for-each already report the signal in
their own failure lines.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 4874f33 into main Oct 20, 2026
38 checks passed
@max-sixty
max-sixty deleted the fix/alias-signal-diagnostic branch October 20, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants