mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-19 01:31:15 -03:00
Fix interactive --on-signal INT handlers
f8ba0ac5bf introduced a bug where INT handlers would themselves be
cancelled, due to the signal. Defer processing handlers until the
parser is ready to execute more fish script.
Fixes the interactive case of #6649.
This commit is contained in:
@@ -2,11 +2,17 @@
|
||||
#
|
||||
# Test signal handling for interactive shells.
|
||||
|
||||
set pid [spawn $fish]
|
||||
expect_prompt
|
||||
|
||||
send_line "function stuffs --on-signal INT; echo SIGINT spotted; end"
|
||||
expect_prompt
|
||||
exec -- kill -INT $pid
|
||||
expect "SIGINT 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.
|
||||
set pid [spawn $fish]
|
||||
expect_prompt
|
||||
send "sleep 130 &\r"
|
||||
expect_prompt
|
||||
send "sleep 131 &\r"
|
||||
|
||||
Reference in New Issue
Block a user