Considering this bug (or a very similar variant) was reported before and the issue just died a silent death, I think it's a good idea to create a Github repo for tracking zsh issues. Github issue tracker is a lot better than mailing lists, as things have a dichotomy of being open/closed, and can be labeled. It is harder for issues to die a silent death there. It is also easier to contribute to that, and easier to unsubscribe (I don't think one can unsubscribe from a mailing list post one participated in, as people (wisely) use reply-all.). On Wed, May 13, 2020 at 10:59 AM Stephane Chazelas wrote: > 2020-05-12 10:38:38 -0700, Bart Schaefer: > > On Tue, May 12, 2020 at 12:03 AM Rudi C > wrote: > > > > > > mdoc-test () { > > > > > > sleep 0 | sleep 0 > > > cat} > > > > > > echo start |VISUAL=vim command vipe|mdoc-test > > > > > > # zsh: suspended (tty output) > > > > Putting an interactive command in the middle of a pipeline is > > generally not going to work. Vim in particular is pretty aggressive > > about trying to grab a terminal, which will result in processes > > getting SIGTT* because they don't have foreground control of the > > terminal they're trying to use. > [...] > > The thing is vim *should* be in the foreground, all the > processes started in pipeline should be in the same process > group which should be in foreground (so it gets > SIGINT/SIGQUIT/SIGTSTP upon ^C/^\/^Z, so it can read the > terminal, etc) but under some circumstances, zsh fails to put > some processes in that group, which is a bug. > > $ &2 > 127235 127235 > $ &2 | ps > -o pid,pgid,comm > 131569 131569 > PID PGID COMMAND > 124948 124948 zsh > 131569 131569 awk > 131570 131569 ps > 131571 131569 sleep > $ &2 | { :; } > 127410 127410 > $ &2 | { : | :; } > 127496 124948 > > In that latter case, awk is in a different process group > (127496) from the terminal foreground process group (124948 > which here is the process group of the main shell process!). > > -- > Stephane >