Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SIGINT swallowed when running non-interactively #5253
Typing the following in at an interactive prompt, hitting enter, then
while true echo hi end
but execute the following script and try to stop it with ctrl+c and it never stops:
#!build/fish while true echo hi end
But it can be backgrounded via ctrl+z, so it's not that signals are blocked, the issue appears to be specific to ctrl+c.
In non-interactive mode, fish squashes SIGINT and instead looks at the exit status of external commands. But if SIGINT arrives while fish is in the foreground then the signal will be dropped. In this case we're only executing builtins so fish is always in the foreground.
Let's just try allowing SIGINT to trigger cancellation.