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

Re: PATCH: that execution stuff



On Jun 29, 12:51pm, Sven Wischnowsky wrote:
} Subject: Re: PATCH: that execution stuff
}
} However, there is still a problem (and this one isn't new, it was
} always like this): the sub-shell created on ^Z has the same pgrp as
} the parent shell and commands started by it use it, too. So if we
} have:
} 
}   % f() { less /etc/termcap; mutt }
}   % f
} 
} and then ^Z the less, fg it, and exit from it, the sub-shell takes
} over and starts mutt *in the pgrp of the parent shell*!

Oy.

} As I said, I
} don't have mutt, but this should then have the effect of stopping the
} parent shell again, right?

Yes.

} The solution would of course be to make the sub-shell use its own
} group

Specifically, the PID of the current job ...

} and have the parent shell correctly handle the
} attachtty()s. The patch tries to do that.

Here's "ps j" output (from another terminal while mutt is in foreground):

 PPID   PID  PGID   SID TTY TPGID  STAT  UID   TIME COMMAND
18625 18626 18626 18626  p3 18631  S     674   0:00 Src/zsh -f 
18626 18631 18631 18626  p3 18631  S     674   0:00 Src/zsh -f 
18631 18632 18631 18626  p3 18631  S     674   0:00 mutt 

Note, mutt is in its own pgrp, exactly as it wants to be.  This is with
3.0.6-pre-5 after patches up to this one, but I don't know why it'd be
different in pws-24.

Thanks, Sven; this finally seems to have nailed the critical bits.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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