diff --git a/README.rst b/README.rst index d7c29f3..9880e3a 100644 --- a/README.rst +++ b/README.rst @@ -3,6 +3,10 @@ A simple VTE-based terminal. Termite looks for ``termite.cfg`` in ``$XDG_CONFIG_HOME`` (or ``~/.config`` if unset) and then falls back to ``$XDG_CONFIG_DIRS``. +Termite's exit status is 1 on a failure, including a termination of the child +process from an uncaught signal. Otherwise the exit status is that of the child +process. + DEPENDENCIES ============ diff --git a/termite.cc b/termite.cc index e2981c3..9e2c66d 100644 --- a/termite.cc +++ b/termite.cc @@ -1147,8 +1147,13 @@ static void load_config(GtkWindow *window, VteTerminal *vte, config_info *info, }/*}}}*/ static void exit_with_status(VteTerminal *vte) { + int status = vte_terminal_get_child_exit_status(vte); gtk_main_quit(); - exit(vte_terminal_get_child_exit_status(vte)); + if (WIFEXITED(status)) { + exit(WEXITSTATUS(status)); + } else { + exit(EXIT_FAILURE); // child did not exit normally + } } int main(int argc, char **argv) {