diff --git a/CHANGELOG.md b/CHANGELOG.md index a14b0fab..46a0d754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/terminal.c b/terminal.c index 6936ff29..45ab146d 100644 --- a/terminal.c +++ b/terminal.c @@ -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);