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

Re: less with subprocess



I am trying some variations based on suggestions from the page Roman linked:

(trap 'kill -PIPE 0' INT; less -f -+F <(eval "sleep 100" ))
/proc/self/fd/11 lines 1--1...skipping...
/proc/self/fd/11 lines 1--1...skipping...
/proc/self/fd/11 lines 1--1...skipping...
/proc/self/fd/11 lines 1--1...skipping...
/proc/self/fd/11 lines 1--1...skipping...
/proc/self/fd/11 lines 1--1...skipping...

the "skipping lines" is what is printed, I assume by less, when I press ctrl-c
I can confirm that using ctrl-z and kill % is able to successfully get rid of the process, but it seems kind of an emergency measure to me, not what I would like to be my routine.
It seems to me that less is eating the ctrl-c, so the trap is never called, because executing the kill -PIPE from another shell works, of course replacing the 0 with the pid of one of the processes involved, sleep or less doesn't matter.
So I'm starting to think this is something that can't be solved from the shell because the shell is unable to do anything until less gives up the control, am I right?

Pier Paolo Grassi


Il giorno lun 27 set 2021 alle ore 23:48 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> ha scritto:
On Mon, Sep 27, 2021 at 2:38 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
>   less -f =(find ...)

Hm, never mind, interrupt kills that subprocess as well so it only
solves half the probem.


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