From 60fca97523ee1e683fe527126e8672a86d6b0a15 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Tue, 3 Mar 2020 21:30:53 +0900 Subject: [PATCH] Add test to verify that the fish_postexec handler is called after SIGINT --- tests/signals.expect | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/signals.expect b/tests/signals.expect index e614ff9bc..1cfc44f06 100644 --- a/tests/signals.expect +++ b/tests/signals.expect @@ -5,6 +5,14 @@ set pid [spawn $fish] expect_prompt +# Verify that the fish_postexec handler is called after SIGINT. +send_line "function postexec --on-event fish_postexec; echo fish_postexec spotted; end" +expect_prompt +send_line read +expect -re "\\r\\n?read> $" +exec -- kill -INT $pid +expect "fish_postexec spotted" + # Verify that sending SIGHUP to the shell, such as will happen when the tty is # closed by the terminal, terminates the shell and the foreground command and # any background commands run from that shell.