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

Re: Bug#303623: [andrew@xxxxxxxxxxx: Bug#303623: zsh: CHECK_JOBS doesn't work when only one command was run since last Control-D]



On Fri, Apr 08, 2005 at 12:05:42AM +0000, Bart Schaefer wrote:
> On Apr 7,  3:10pm, Clint Adams wrote:
> }
> } When a job is still running and the CHECK_JOBS is set, zsh should only
> } exit when it receives two exit requests in a row.  However, sometimes it
> } honors an exit request in other conditions.  One repeatable case is when
> } the request is a Control-D and there was only one command run since the
> } last exit request.
> 
> The issue here seems to be that zsh doesn't actually receive a ctrl-D
> keystroke, but rather that there is a true end-of-file on the tty.

Ok, but I don't think this should preclude correct behavior.  My
understanding is that when <C-D> is pressed, the application gets a
zero-length read on the terminal, but that a subsequent read will get
more keyboard input (or another zero-length read if <C-D> is pressed
again).  So zsh should still be able to detect each press of <C-D>
reliably.

> If you try, for example, running zsh and then starting another zsh from
> within the first, then when you force the "inner" zsh to exit, the "outer"
> one sometimes exits as well.

Hmm, mysterious.  I should have also said in my message that I think
I've seen unexpected exits in other cases, but the one I posted is the
only one I could reproduce.  It sounds like there is a subtle bug in
zsh.

> There may actually be some kind of race condition here, because sometimes
> only the "inner" shell exits.  It might even be an xterm bug.
> 
> Here's a much simpler example to reproduce the base problem:

Right, I should have explained that I gave a longer example to show that
1) exit and <C-D> act differently and 2) running two commands between
<C-D>s behaves as expected.

Andrew



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