From 0f56db55a26192afceb790e3ea57db541e9859e1 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 13 Jan 2024 15:13:59 -0800 Subject: [PATCH] Correct "fire_exit" event back to "fish_exit" This was causing fish_exit to not fire, which caused (among other things) leaking tmux processes from the tests. This was bisected to eacbd6156d9474b544d --- src/bin/fish.rs | 2 +- tests/checks/fish_exit.fish | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/checks/fish_exit.fish diff --git a/src/bin/fish.rs b/src/bin/fish.rs index 9a4d837bb..0b613f11c 100644 --- a/src/bin/fish.rs +++ b/src/bin/fish.rs @@ -763,7 +763,7 @@ fn main() { // Trigger any exit handlers. event::fire_generic( parser, - L!("fire_exit").to_owned(), + L!("fish_exit").to_owned(), vec![exit_status.to_wstring()], ); diff --git a/tests/checks/fish_exit.fish b/tests/checks/fish_exit.fish new file mode 100644 index 000000000..77d063c3d --- /dev/null +++ b/tests/checks/fish_exit.fish @@ -0,0 +1,8 @@ +#RUN: %fish -C 'set -g fish %fish' %s + +# fish_exit fires successfully. +echo 'function do_exit --on-event fish_exit; echo "fish_exiting $fish_pid"; end' > /tmp/test_exit.fish +$fish /tmp/test_exit.fish +# CHECK: fish_exiting {{[0-9]+}} + +rm /tmp/test_exit.fish