mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 12:41:08 +08:00
Correctly cancel on receipt of SIGHUP
When we receive SIGHUP, stop executing normal fish script (but allow exit handlers to run).
This commit is contained in:
parent
0b075fce88
commit
0379f21870
|
@ -806,8 +806,8 @@ static void term_steal() {
|
|||
bool check_cancel_from_fish_signal() {
|
||||
switch (s_exit_state) {
|
||||
case exit_state_t::none:
|
||||
// No reason to exit now.
|
||||
return false;
|
||||
// Cancel if we got SIGHUP.
|
||||
return s_sighup_received;
|
||||
case exit_state_t::running_handlers:
|
||||
// We intend to exit but we want to allow these handlers to run.
|
||||
return false;
|
||||
|
|
|
@ -62,7 +62,8 @@ send("sleep 130 &\r")
|
|||
expect_prompt()
|
||||
send("sleep 131 &\r")
|
||||
expect_prompt()
|
||||
send("sleep 132\r")
|
||||
send("sleep 9999999\r")
|
||||
sleep(0.100) # ensure fish kicks off the above sleep before it gets HUP - see #7288
|
||||
os.kill(sp.spawn.pid, signal.SIGHUP)
|
||||
|
||||
# Verify the spawned fish shell has exited.
|
||||
|
|
Loading…
Reference in New Issue
Block a user