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

Re: problem with 'ls | less' shell function



On Sat, Oct 22, 2022 at 4:22 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> However, it must be the case that something is sending
> SIGCONT to "less" before the attachtty() has a chance to ... actually
> change the process group?  If I stop at the point where the SIGCONT is
> sent, and call getprp() from the debugger, the process group still
> belongs to the parent shell despite the apparently successful call to
> attachtty().

If I instrument attachtty():
[1]  + continued  ls -lrRt |
zsh: ep = 0 and last_attached_pgrp = 276698 in 276698
zsh: last_attached_pgrp now 276716 in 276698, gettygrp = 276716
zsh: suspended (tty output)  ls -lrRt |
zsh: suspended (tty output)  ls -lrRt |

So as far as zsh knows, the attachtty() was successful, but if the
debugger is telling the truth, something is resetting the tty pgrp
again without attachtty() being called.

I'm out of time to chase this today.




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