Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Possible signal handling issues

On Jan 2, 10:53pm, Peter Stephenson wrote:
} Just to finish off this train of thought:  I'm sure Bart remembers this,
} but it's worth reminding home viewers that if TRAPINT returns status
} 0, which it usually will with then kill last, then the job controller assumes
} the signal was already handled, so doesn't take any action to pass the
} signal on to the job itself.  If I add "return 1" to the end of
} TRAPINT() I only ever see the output once before the job ends.

I wasn't specifically considering that, but I think it's irrelevant. [*]
What I was pointing out is that it shouldn't be possible for signal N
to be delivered during the trap handler for that same signal, but the
way zsh "queues" signal handlers means that the TRAPN() function is not
usually called "during" the delivery of the signal.

} I think I've now lost interest in this...

Fair enough.

[*] It does suggest that Chris Johnson's script could possibly be improved
by replacing "kill -HUP $$" with a simple "return 1".  Haven't tried it.

Messages sorted by: Reverse Date, Date, Thread, Author