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

RE: PATCH: loop killing



>
> > It is even worse
> >
> > bor@itsrm2:~%> while true
> > do
> > zcat
> > done
> > ^Z^Z^Z^Z^Z^Z^Z
> >
> > Nothing happens at all.
>
> This works for me.
>

It works for me for zsh with SHLVL > 1 :

bor@itsrm2:~%> echo $SHLVL
1
bor@itsrm2:~%> zsh
bor@itsrm2:~%> while true
while> do
while> zcat
while> done
^Zzsh: suspended  while true; do; zcat; done
bor@itsrm2:~%> echo $SHLVL
2
bor@itsrm2:~%> exit
bor@itsrm2:~%> echo $SHLVL
1
bor@itsrm2:~%> ps
   PID TTY      TIME CMD
  4598 pts/5    0:01 zsh
bor@itsrm2:~%>

Note, that no notification "you have stopped jobs" appear. But

bor@itsrm2:~%> zcat
^Z
zsh: suspended  zcat
bor@itsrm2:~%> exit
zsh: you have suspended jobs.
bor@itsrm2:~%> echo $SHLVL
1

Something is fishy. The same happens for me either under dtterm or xterm or in
telnet login zsh. dtterm and zsh run in different process groups.

The only difference, that I currently can see, is, that when it does not work,
zsh is session leader:

bor@itsrm2:~%> ps -j
   PID  PGID   SID TTY      TIME CMD
  4598  4598  4598 pts/5    0:02 zsh

but

bor@itsrm2:~%> zsh
bor@itsrm2:~%> ps -j
   PID  PGID   SID TTY      TIME CMD
  4598  4598  4598 pts/5    0:03 zsh
  6897  6897  4598 pts/5    0:00 zsh
bor@itsrm2:~%>


For some reason, in the first case Zsh does not get SIGCHLD (or is ignoring it)
and does not know that child was stopped.

/andrej



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