From b67a614d8605c3ad6eccd1a95898f82bd87fa79e Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 3 Feb 2018 16:38:15 +0100 Subject: [PATCH] Replace the process-exit event with generic "fish_exit" event Turns out the process-exit is only ever used in conjunction with `%self`. Make that explicit by just adding a new "fish_exit" event, and deprecate the general process-exit machinery. Fixes #4700. --- src/fish.cpp | 3 +++ src/proc.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/fish.cpp b/src/fish.cpp index 4f6035a73..5568086b7 100644 --- a/src/fish.cpp +++ b/src/fish.cpp @@ -437,7 +437,10 @@ int main(int argc, char **argv) { int exit_status = res ? STATUS_CMD_UNKNOWN : proc_get_last_status(); + // 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"); restore_term_mode(); restore_term_foreground_process_group(); diff --git a/src/proc.cpp b/src/proc.cpp index 0776dd091..b349aaf63 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -537,6 +537,8 @@ static int process_clean_after_marking(bool allow_interactive) { s = p->status; + // TODO: The generic process-exit event is useless and unused. + // Remove this in future. proc_fire_event(L"PROCESS_EXIT", EVENT_EXIT, p->pid, (WIFSIGNALED(s) ? -1 : WEXITSTATUS(s))); @@ -601,6 +603,8 @@ static int process_clean_after_marking(bool allow_interactive) { format_job_info(j, JOB_ENDED); found = 1; } + // TODO: The generic process-exit event is useless and unused. + // Remove this in future. // Don't fire the exit-event for jobs with pgid -2. // That's our "sentinel" pgid, for jobs that don't (yet) have a pgid, // or jobs that consist entirely of builtins (and hence don't have a process).