From d776a366faecc51832a76582bc5171aaddd985c7 Mon Sep 17 00:00:00 2001 From: "Stephen M. Coakley" Date: Thu, 3 Jan 2019 22:20:43 -0600 Subject: [PATCH] Pass final Fish exit status to fish_exit event For fish_exit to be a suitable replacement for --on-process-exit, we need to be able to provide scripts with access to the shell's final exit code. --- src/fish.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fish.cpp b/src/fish.cpp index 49110ac1e..c213321d9 100644 --- a/src/fish.cpp +++ b/src/fish.cpp @@ -440,7 +440,10 @@ int main(int argc, char **argv) { // TODO: The generic process-exit event is useless and unused. // Remove this in future. proc_fire_event(L"PROCESS_EXIT", EVENT_EXIT, getpid(), exit_status); - event_fire_generic(L"fish_exit"); + + // Trigger any exit handlers. + wcstring_list_t event_args = {to_string(exit_status)}; + event_fire_generic(L"fish_exit", &event_args); restore_term_mode(); restore_term_foreground_process_group();