fix: Propagate correct exit codes on signal termination (Unix)#24
fix: Propagate correct exit codes on signal termination (Unix)#24insign wants to merge 1 commit into
Conversation
When a child process terminates due to a signal (like SIGTERM or SIGKILL), `status.code()` returns `None` on Unix systems. Previously, `run` mapped this to a generic error code (1). This change checks for the termination signal via `ExitStatusExt` and computes the standard shell-compatible exit code (`128 + signal`), improving integrations with scripts, shells, and CI pipelines. On non-Unix platforms, it continues to return the generic error code. Co-authored-by: insign <1113045+insign@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR improves the CLI's handling of processes that are killed by signals. It maps
Noneexit codes to standard shell-compatible exit codes (128 + signal) on Unix platforms, allowing callers to correctly interpret termination causes (e.g., distinguishing between a clean failureexit 1and a signal terminationkill -9).This is a valuable improvement for developers using
runwithin automated scripts, system services, or continuous integration environments where reliable signal propagation is expected behavior.PR created automatically by Jules for task 25870807027458885 started by @insign