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

Re: less with subprocess



On Wed, Sep 29, 2021 at 6:02 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> cventin% LF () { () { cat >$1 &! less $1 ; kill $! } =(:) }
> cventin% echo | LF
> (anon):kill: kill 27684 failed: no such process

Yeah, if you use it with a process that produces very little output,
the kill will fail.  But there's no point in using it in that case.
Redirect stderr of kill if this bothers you.

> And
>
> cventin% (sleep 1; echo foo) | LF
>
> gives an empty file in "less"

Yes, you have to hit "F" in less to reload / wait for the file
contents.  I suppose "less +F" might be preferable.  There are still
some signal handling issues with having a subshell on the left side of
the pipe, which might very well indicate that there is still a zsh (or
"less"?) bug with signal propagation.




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