Revert "correct handling of SIGHUP by interactive fish"

This reverts commit 31adc221d9.
This commit is contained in:
Kurtis Rader
2017-01-24 07:34:15 -08:00
parent 31adc221d9
commit 64485167e9
8 changed files with 19 additions and 85 deletions

View File

@@ -1,37 +0,0 @@
# vim: set filetype=expect:
#
# Test handling of the `exit` command.
set pid [spawn $fish]
expect_prompt
# Verify that if we attempt to exit with a job in the background we get warned
# about that job and are told to type `exit` a second time.
send "sleep 111 &\r"
expect_prompt
send "exit\r"
expect "There are still jobs active"
expect "A second attempt to exit will terminate them."
expect_prompt
# Running anything other than `exit` should result in the same warning with
# the shell still running.
send "sleep 113 &\r"
expect_prompt
send "exit\r"
expect "There are still jobs active"
expect "A second attempt to exit will terminate them."
expect_prompt
# Verify that asking to exit a second time does so.
send "exit\r"
close
wait
# Verify all child processes have been killed. We don't use `-p $pid` because
# if the shell has a bug the child processes might have been reparented to pid
# 1 rather than killed.
set status [catch {exec pgrep -l -f "sleep 11"} output]
if {$status == 0} {
puts stderr "Commands spawned by the shell still running after `exit`"
puts stderr $output
}

View File

View File

View File

@@ -1,28 +0,0 @@
# vim: set filetype=expect:
#
# Test signal handling for interactive shells.
# 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"
expect_prompt
send "sleep 132\r"
exec -- kill -HUP $pid
# Verify the spawned fish shell has exited.
close
wait
# Verify all child processes have been killed. We don't use `-p $pid` because
# if the shell has a bug the child processes might have been reparented to pid
# 1 rather than killed.
set status [catch {exec pgrep -l -f "sleep 13"} output]
if {$status == 0} {
puts stderr "Commands spawned by the shell still running after SIGHUP"
puts stderr $output
}