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

Re: [Bug] Unexpected process suspension



On Tue, May 12, 2020 at 12:03 AM Rudi C <rudiwillalwaysloveyou@xxxxxxxxx> 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.

Following Daniel's response I tried:

% </dev/null vim | { :|:; cat }
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal

and although vim did open, upon exiting from it and returning to the
command line ZLE is very confused.  Even a hard reset of the terminal
emulator didn't fix it, the stty settings were hosed.



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