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

Re: 3.0.6-pre-5 problem



Bart Schaefer wrote:

> On Jun 25,  9:17am, Bart Schaefer wrote:
> } Subject: Re: 3.0.6-pre-5 problem
> }
> } [...]  I think zsh
> } may have sent a STOP signal to the xterm that is its parent.
> 
> Yup, I can confirm this:
> 
> zagzig% Src/zsh -f
> zagzig% echo $SHLVL
> 4
> zagzig% Src/zsh -f
> zagzig% echo $SHLVL
> 5
> zagzig% mutt () {
> function>       command mutt "$@"
> function>       echotc rs
> function> }
> zagzig% mutt
> zsh: suspended (signal)  Src/zsh -f
> zagzig% echo $SHLVL
> 4
> 
> Zsh has just stopped its parent.  Naughty zsh.

Err, itself, right?

That was a hint... (I still wonder why I can't reproduce it, though).

I hope this fixes it. It's the only place where a parent shell sends a 
SIGSTOP and, yes, it's good to have that extra test there -- it means
roughly that we don't need to suspend the beginning of a pipeline if
there is no such beginning -- exactly what happens when suspending a
function.


Bye
 Sven

--- os/exec.c	Fri Jun 25 10:06:02 1999
+++ Src/exec.c	Fri Jun 25 11:32:57 1999
@@ -966,7 +966,7 @@
 			close(synch[1]);
 			read(synch[0], &dummy, 1);
 			close(synch[0]);
-			/* If this job has finished, we turn this into a
+			/* If this job has finished, we leave it as a
 			 * normal (non-super-) job. */
 			if (!(jn->stat & STAT_DONE)) {
 			    jobtab[list_pipe_job].other = newjob;
@@ -974,7 +974,7 @@
 			    jn->stat |= STAT_SUBJOB | STAT_NOPRINT;
 			    jn->other = pid;
 			}
-			if (list_pipe || last1)
+			if ((list_pipe || last1) && jobtab[list_pipe_job].procs)
 			    killpg(jobtab[list_pipe_job].gleader, SIGSTOP);
 			break;
 		    }

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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