Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: does zsh ignore the QUIT signal?
- X-seq: zsh-users 10107
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: does zsh ignore the QUIT signal?
- Date: Wed, 29 Mar 2006 20:09:48 +0100
- In-reply-to: Message from Vincent Lefevre <vincent@xxxxxxxxxx> of "Wed, 29 Mar 2006 11:03:39 +0200." <20060329090339.GF22295@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Vincent Lefevre wrote:
> When I type "while true; do true; done" from an interactive zsh shell,
> I can't interrupt it with SIGQUIT (either with Ctrl-\ or with the
> "kill -QUIT <pid>" command): sending this signal has no effect. Is
> this normal?
Yes, although I had to search the source code to find this out. The
shell has ignored it at least as far back as the CVS archive goes (April
1999).
This should let you interrupt the shell with it:
TRAPQUIT() { return $(( 128 + $1 )); }
It doesn't set the return status, unlike SIGINT, however (and because
it's handled there's no core dump).
This documents it.
Index: Doc/Zsh/jobs.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/jobs.yo,v
retrieving revision 1.4
diff -u -r1.4 jobs.yo
--- Doc/Zsh/jobs.yo 2 Jul 2004 14:59:14 -0000 1.4
+++ Doc/Zsh/jobs.yo 29 Mar 2006 19:04:07 -0000
@@ -95,6 +95,7 @@
The tt(INT) and tt(QUIT) signals for an invoked
command are ignored if the command is followed by
`tt(&)' and the tt(MONITOR) option is not active.
+The shell itself always ignores the tt(QUIT) signal.
Otherwise, signals have the values
inherited by the shell from its parent
(but see the tt(TRAP)var(NAL) special functions in noderef(Functions)).
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page still at http://www.pwstephenson.fsnet.co.uk/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author