Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: problem with 'ls | less' shell function
> 2022/10/19 17:26, zsugabubus@national.shitposting.agency wrote:
>
> 15bf8ace168a86d0fae90b10e9f706baddd4c0bf is the first bad commit
> 50134: Tweak process group handling to prevent unkillable pipelines
This is for solving the problem that pipelines like the following
can't be interrupted by ^C:
zsh% { /bin/sleep 10 ; /bin/sleep 11; echo done 1; } |
{ /bin/sleep 12 ; /bin/sleep 13; echo done 2; }
After the commit ^C works. But if we suspend/resume it by ^Z/fg,
the pipeline never finishes. We get the output 'done 2', but
not 'done 1', nor the next prompt (^C works). After we get 'done 2',
if we run 'ps -Oppid,pgid,tpgid' in another terminal:
PID PPID PGID TPGID S TTY TIME COMMAND
2447 .... 2447 3644 S pts/0 00:00:00 zsh
3644 2447 3644 3644 R pts/0 00:00:37 zsh
3645 3644 3644 3644 Z pts/0 00:00:00 [sleep] <defunct>
2447 is the main zsh, 3644 is the subshell for the left hand side
of the pipeline, and 3645 is 'sleep 10'.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author