Skip to main content

Module exit_status

Module exit_status 

Source
Expand description

Exit-status mapping shared by every path that runs a child command (#1881).

ExitStatus::code() is None when the child was terminated by a signal. Mapping that to 1 made a SIGTERM’d or SIGKILL’d command look like an ordinary failure — or, for grep-style commands with output, like success. Shells report such a child as 128 + signal, and so do we.

Functions§

exit_code
The shell-convention exit code of a finished child: its exit code, or 128 + signal when a signal terminated it (130 SIGINT, 137 SIGKILL, 143 SIGTERM, …).
exit_footer
exit_marker as a footer: empty on success, otherwise the marker on its own line.
exit_marker
The [exit:N] marker appended to a failed command’s output, without a leading newline. None on success. Timeouts (124, #815) and signal terminations are spelled out so an agent does not mistake them for an ordinary failure.