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

Re: less with subprocess



On 2021-09-29 10:56:30 -0700, Bart Schaefer wrote:
> On Wed, Sep 29, 2021 at 7:47 AM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
> >
> > LF () { () { cat >|$1 &! less $1 ; kill $! } =(:) }
> >
> > find | LF
> >
> > unfortunately when hitting F then ctrl-c in less the find process is immediately killed
> 
> You can get around that with
> 
> LF <<(find)

This is much worse! Ctrl-C then [End] yields

  zsh: suspended (tty input)

then "fg" makes the terminal unusable.

> There could be some more failsafe stuff in "LF".  For example if you
> accidentally invoke it with stdin still connected to the terminal
> instead of to a pipe, "cat" will be stopped with SIGTTIN and left
> lurking.

The above issue?

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




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