From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19239 invoked from network); 22 Mar 2001 06:36:21 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Mar 2001 06:36:21 -0000 Received: (qmail 21261 invoked by alias); 22 Mar 2001 06:36:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13698 Received: (qmail 21248 invoked from network); 22 Mar 2001 06:36:12 -0000 From: "Bart Schaefer" Message-Id: <1010322063513.ZM19685@candle.brasslantern.com> Date: Thu, 22 Mar 2001 06:35:12 +0000 In-Reply-To: <200103211441.PAA29343@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: `make' completion in zsh-3.1.9" (Mar 21, 3:41pm) References: <200103211441.PAA29343@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: `make' completion in zsh-3.1.9 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 21, 3:41pm, Sven Wischnowsky wrote: } Subject: Re: `make' completion in zsh-3.1.9 } } > } Bart Schaefer wrote: } > } } > } > zsh% while read -e; do :; done < Makefile | less } > } > } > } > hangs until interrupted. This works: } > } > } > } > zsh% { while read -e; do :; done < Makefile } | less } } The problem is that the loop is not put in a sub-shell. Ahem. } } And w.r.t. the code in execcmd() this is correct (of, course, code is } always correct, silly me). But how can we solve this? Didn't it once } work? It works in 3.0.8. } Changing the test at exec.c:1968 to also test for is_cursh } makes it work only half the way -- less comes up, but if one leaves it } (fast enough) the sub-shell gets blocked, trying to write into the } pipe and being too stupid to find out that it can't anymore. You can see this by making the change Sven describes and then piping to "head -1" instead of less. } I'm very much confused... anyone know what we are supposed to do now? Why does it work when the while-construct is wrapped with { } ? Why can't we "pretend" -- in the wordcode compiler, if necessary -- that every complex command is wrapped with { } ? `{ LIST }' should be semantically equivalent to `LIST', right? The tricky bit is that it has to be possible to traverse the wordcode in such a way as to regenerate the original input without inserting zillions of "extraneous" braces. (I've often suspected that this strange double duty that's imposed on zsh's syntax trees is responsible for a lot of needless complexity in exec.c.) Perhaps a special type-value for the wordcode node to indicate that the braces should not be output? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net