Repository navigation
feat(interpreter): deliver signals the shell sends itself - #2608
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | c0b17f7 | Commit Preview URL Branch Preview URL |
Oct 08 2026, 01:46 AM |
kill -SIG $$ now runs that signal's trap, or ends the script with 128 + signal when no handler is set. It used to be a silent no-op. Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
chaliy
force-pushed
the
claude/kill-self
branch
from
October 8, 2026 01:45
f67d40d to
c0b17f7
Compare
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
kill -SIG $$, the shell signalling itself, is now delivered instead of being dropped:trapset for that signal, the handler runs, under any spellingtrapaccepts (TERM,SIGTERM,15), and anexitinside the handler ends the script.kill -9 $$gives 137,kill -TERM $$143,kill -INT $$130.kill -0 $$still only tests for the process.Why
Debian-oracle cases
exit-codes-signalsandtrap-signal-self. A script that ends itself withkill -TERM $$after a failed check, or that usestrap ... USR1; kill -USR1 $$to run a handler, carried on as if nothing had happened and exited 0.Before / After
kill -9 $$; echo afterafter, exits 0afternot runkill -TERM $$trap 'echo caught' TERM; kill -TERM $$; echo afteraftercaught, thenaftertrap 'echo bye; exit 143' TERM; kill -TERM $$bye, exit 143kill -0 $$; echo $?0New spec file
kill-self.test.sh(4 cases), verified against bash 5.2.Risk
Medium-low. The kill builtin reports it through a new
SignalSelfside effect, so the interpreter decides; nothing else changes aboutkill. The ERR-trap runner was refactored onto the shared handler-runner this needed, with the same behavior. L-SIG-001 is narrowed rather than removed: no signal can arrive from outside the sandbox, and its evidence test now asserts the new behavior.Checklist
cargo test -p bashkit --lib,--test integration, bash_comparison (2903 cases)cargo clippy --all-targets -D warnings,cargo fmt --check,just check-okfhttps://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Generated by Claude Code