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

Re: Bug in sh emulation



Not so much a follow up as a separate point...

If we're letting the subshell do job control (not resetting MONITOR in
entersubsh() because POSIXJOBS is set), then presumably we shouldn't be
resetting the signals that are special to shells that do job control?

This actually makes the issue go away, but I'm not sure at all sure it's
the basic issue; it's part of the stuff I'm hoping Mystified of Marin
County might know a little more about.

Having said that, the shell does make strenuous efforts to ignore these
signals when doing job control, so I'm reasonable sure this is the right
thing to do here.

Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.205
diff -p -u -r1.205 exec.c
--- Src/exec.c	26 Oct 2011 18:48:13 -0000	1.205
+++ Src/exec.c	11 Dec 2011 19:32:17 -0000
@@ -959,7 +959,7 @@ entersubsh(int flags)
     if ((flags & ESUB_REVERTPGRP) && getpid() == mypgrp)
 	release_pgrp();
     shout = NULL;
-    if (isset(MONITOR)) {
+    if (isset(MONITOR) && !isset(POSIXJOBS)) {
 	signal_default(SIGTTOU);
 	signal_default(SIGTTIN);
 	signal_default(SIGTSTP);

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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