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

Re: problem with 'ls | less' shell function



Sorry, I didn't notice this post:

> 2022/10/19 17:26, zsugabubus@national.shitposting.agency wrote:
> 
> $ f(){echo|sleep 60}
> $ f
> ^Z
> $ fg
> ^Z^Z^C^C^C^C^C^\

Thnaks.
Now I understand that we need to use function to reproduce the problem.
% ls | less      # works fine
but
% dir () { ls | less }
% dir     # this has the problem

> 15bf8ace168a86d0fae90b10e9f706baddd4c0bf is the first bad commit
> 50134: Tweak process group handling to prevent unkillable pipelines

Thanks again.

> I think what happens is that zsh fails to correctly set the foreground
> process group in `fg`. `less` is not in the foreground pgrp that's why
> it immediately gets suspended by SIGTTIN after it receives SIGCONT.


Yes, and I guess it is related with the code in wait_for_processes(),
signals.c, lines 540-557.




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