mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
term: shutdown: special case child terminating due to SIGHUP
When closing the window via a compositor shortcut, or clicking the CSD close button, we kill the client application by sending it SIGHUP (and then SIGTERM followed by SIGKILL, if it refuses to die). Many shells either don't catch SIGHUP, causing us to exit with a non-zero value, or they catch it, and then _they_ exit with a non-zero value, causing _us_ to propagate that to the user. This patch changes foot's behavior to "ignore" death-by-sighup, and always exit with value 0. The log message is changed to debug level, for SIGHUP only; other death-by-signal is still logged at the warning level.
This commit is contained in:
parent
51128a3484
commit
cbe1c2fe75
2 changed files with 8 additions and 1 deletions
|
|
@ -72,6 +72,9 @@
|
|||
* Do not try to set a zero width, or height, if the compositor sends a
|
||||
_configure_ event with only one dimension being zero
|
||||
([#1925][1925]).
|
||||
* Exit with value `0` when the client process exits due to us sending
|
||||
it `SIGHUP`. This happens for example when closing the window with
|
||||
either a compositor shortcut, or clicking the CSD _close_ button.
|
||||
|
||||
[1925]: https://codeberg.org/dnkl/foot/issues/1925
|
||||
|
||||
|
|
|
|||
|
|
@ -1978,7 +1978,11 @@ term_destroy(struct terminal *term)
|
|||
LOG_DBG("slave exited with code %d", ret);
|
||||
} else if (WIFSIGNALED(exit_status)) {
|
||||
ret = WTERMSIG(exit_status);
|
||||
LOG_WARN("slave exited with signal %d (%s)", ret, strsignal(ret));
|
||||
if (ret == SIGHUP) {
|
||||
LOG_DBG("slave exited with signal %d (%s)", ret, strsignal(ret));
|
||||
ret = 0;
|
||||
} else
|
||||
LOG_WARN("slave exited with signal %d (%s)", ret, strsignal(ret));
|
||||
} else {
|
||||
LOG_WARN("slave exited for unknown reason (status = 0x%08x)",
|
||||
exit_status);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue