mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-04 07:15:29 -04: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
|
|
@ -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