Fix Ctrl-C signals test

Prior to this change, signals.py attempted to generate Ctrl-C (SIGINT) by
sending \x03 to stdin. But with the change to use the CSI U sequence, Ctrl-C no
longer generates SIGINT.

Switch to sending SIGINT directly. Also switch up some of the sleep constants so
that a sleep command can't be confused with another one.
This commit is contained in:
ridiculousfish 2024-05-05 14:51:03 -07:00
parent 9320fb52bb
commit 269b18532d

View file

@ -28,18 +28,18 @@ expect_prompt()
# Verify that SIGINT inside a command sub cancels it.
# Negate the pid to send to the pgroup (which should include sleep).
sendline("while true; echo (sleep 1000); end")
sendline("while true; echo (sleep 2000); end")
sleep(0.5)
os.kill(-sp.spawn.pid, signal.SIGINT)
expect_prompt()
sendline("sleep 10 &")
# SIGINT should be ignored by background processes.
sendline("sleep 1234 &")
expect_prompt()
send("\x03")
os.kill(-sp.spawn.pid, signal.SIGINT)
sleep(0.010)
sendline("jobs")
expect_prompt("sleep.10")
expect_prompt("sleep 1234")
sendline("kill %1")
expect_prompt()