diff --git a/CHANGELOG.md b/CHANGELOG.md index ac9247e5..ab8d4b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,9 @@ (https://codeberg.org/dnkl/foot/issues/924). * Crash in `pipe-scrollback` (https://codeberg.org/dnkl/foot/issues/926). +* Exit code being 0 when a foot server with no open windows terminate + due to e.g. a Wayland connection failure + (https://codeberg.org/dnkl/foot/issues/943). ### Security diff --git a/main.c b/main.c index ff839507..4011dcde 100644 --- a/main.c +++ b/main.c @@ -642,14 +642,14 @@ main(int argc, char *const *argv) goto out; } + ret = EXIT_SUCCESS; while (likely(!aborted && (as_server || tll_length(wayl->terms) > 0))) { - if (unlikely(!fdm_poll(fdm))) + if (unlikely(!fdm_poll(fdm))) { + ret = foot_exit_failure; break; + } } - if (aborted || tll_length(wayl->terms) == 0) - ret = EXIT_SUCCESS; - out: free(_cwd); server_destroy(server);