I frequently work with PostgreSQL for debugging, and it uses SIGINT
internally for some of its inter-backend signalling.
As a result when running certain ba
On UNIX-like systems, you can distinguish a tty-initiated SIGINT from one sent by kill
by looking at the si_pid
element in the siginfo struct. If the pid is 0, it came from a tty.
So you could do something like this:
catch signal SIGINT
commands
if $_siginfo._sifields._kill.si_pid == 0
print "Received SIGINT from tty"
else
printf "Received SIGINT from %d; continuing\n", $_siginfo._sifields._kill.si_pid
signal SIGINT
end
end