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

Re: problem with 'ls | less' shell function



OK, perhaps we're getting somewhere.  Still working with suspend of
dir() { ls -lrRt | less }

In bin_fg(), line 2564, we
attachtty(jobtab[jobtab[job].other].gleader)) which is using the
correct PID.  We then enter waitjobs() which calls waitonejob() for
that PID (so far so good).  However, that returns immediately, because
at that point the pipeline gets SIGTTOU -- which is confusing, because
it should be attached to the tty.  In any case, waitjobs() then falls
through to waiting for the function subshell, which is the also the
right thing.

It's a bit hard to follow here because sometimes the "other" field of
the jobtab struct is an offset into jobtab, and sometimes its an
actual PID, but the parent shell's internal record-keeping seems to be
correct.  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().




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