From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15156 invoked by alias); 12 Dec 2011 19:16:51 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30018 Received: (qmail 8180 invoked from network); 12 Dec 2011 19:16:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 209.85.215.171 is neither permitted nor denied by SPF record at ntlworld.com) X-ProxyUser-IP: 86.6.29.42 Date: Mon, 12 Dec 2011 19:16:25 +0000 From: Peter Stephenson To: Subject: Re: Bug in sh emulation Message-ID: <20111212191625.0d0e09b9@pws-pc.ntlworld.com> In-Reply-To: <111212101000.ZM1865@torch.brasslantern.com> References: <111209184747.ZM5000@torch.brasslantern.com> <20111210194022.5051f91c@pws-pc.ntlworld.com> <20111210232801.7dc8fef2@pws-pc.ntlworld.com> <20111211193949.2d58062b@pws-pc.ntlworld.com> <20111211202024.07c046df@pws-pc.ntlworld.com> <20111211205658.365243c7@pws-pc.ntlworld.com> <111211153918.ZM32739@torch.brasslantern.com> <20111212100100.0696825b@pwslap01u.europe.root.pri> <111212074417.ZM1511@torch.brasslantern.com> <20111212160617.6ee3026c@pwslap01u.europe.root.pri> <111212101000.ZM1865@torch.brasslantern.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 12 Dec 2011 10:10:00 -0800 Bart Schaefer wrote: > On Dec 12, 4:06pm, Peter Stephenson wrote: > } > } I think this must be OK (unless, of course, something is failing where I > } don't see it). The chunk of code in entersubsh() we've been staring at > } is the one that's only executed if there's no group leader, and in that > } case it creates its own process group and attaches that to the tty > > Right. My lingering doubt is that "no group leader" doesn't necessarily > mean "no other group attached to the tty", if we've been given some wacky > structure like > > (emulate sh -c "(foo | bar)" | emulate zsh -c "(baz | ding)") | read -E The last patch attempted to do a bit better in limiting the cases where the MONITOR option was left on to a straightforward subshell. In this example, the first fork is for a pipeline rather than subshell, so MONITOR should be turned off before the subshell is started --- it's perfectly possible I've missed a passage through the maze that should do that, though. We might well get into problems if MONITOR is explicitly turned back on, but I don't have so much sympathy there. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/