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

Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups

On Mon, 23 Apr 2018 21:58:52 +0900
Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> After the following commit:
> commit 3c74891fcd68d37c1629943f703ac70428e3ce9f
> Author: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
> Date:   Fri Apr 13 12:09:34 2018 +0100
>     42630: Improve process group handling in pipelines.
> a simple pipeline like the following fails:
> zsh% ls | less
> zsh: done                    ls | 
> zsh: suspended (tty output)  less
> With the current master (9e2afb92987d7fd96a838c15b6641cc1b634a825)
> 'tty output' is replaced by 'tty input'.

Somehow nobody's noticed that yet...  I think there's a race, making
this only happen sometimes, presumably with greater frequency on some
systems than others.  That's not going to help matters.  I've managed to
get it to happen a couple of times.

This problem suggesting something basic in the ordering of events.

ls has presumably exited and presumably also been reaped, or we don't
get the new behaviour --- I guess this happened in such a way that less
can't grab the terminal back from the shell.

Hmmm --- I wonder if less was already forked and that's the problem?  So
maybe we should check if there are other processes already forked and
avoid resetting the pgrp leader in that case?  Does anyone actually


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