From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9529 invoked from network); 29 Jun 1999 14:43:44 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Jun 1999 14:43:44 -0000 Received: (qmail 3978 invoked by alias); 29 Jun 1999 14:43:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6925 Received: (qmail 3971 invoked from network); 29 Jun 1999 14:43:36 -0000 From: "Bart Schaefer" Message-Id: <990629144301.ZM20707@candle.brasslantern.com> Date: Tue, 29 Jun 1999 14:43:01 +0000 In-Reply-To: <199906291051.MAA23127@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: PATCH: that execution stuff" (Jun 29, 12:51pm) References: <199906291051.MAA23127@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: that execution stuff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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