From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9979 invoked from network); 19 May 2000 08:30:36 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 May 2000 08:30:36 -0000 Received: (qmail 11201 invoked by alias); 19 May 2000 08:30:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11465 Received: (qmail 11194 invoked from network); 19 May 2000 08:30:26 -0000 From: "Bart Schaefer" Message-Id: <1000519083021.ZM282@candle.brasslantern.com> Date: Fri, 19 May 2000 08:30:21 +0000 In-Reply-To: <200005190743.JAA05852@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: PATCH (?): Re: suspend while loop." (May 19, 9:43am) References: <200005190743.JAA05852@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH (?): Re: suspend while loop. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 19, 9:43am, Sven Wischnowsky wrote: } Subject: Re: PATCH (?): Re: suspend while loop. } } Bart Schaefer wrote: } } > The thing that most worries me is that zread() can invoke zle, which can } > invoke shell functions, which .... } } No, it only uses getkey() which doesn't call functions. It's just a } read-one-char that works while zle is active. But it should be } possible to avoid the child_unblock() when `izle != 0', I think. I don't think that's worth the effort and the messiness; `read' is going to spend the vast majority of its time in the read-one-character loops, so as long as the signal changes are outside those loops it should be OK. BTW, I just noticed this: echo -n foo | read line echo $? echo $line By comparison, bash also gives $? == 1 but NOT $line == foo. (Why is lack of a trailing newline an error?) } > Another question is, is there a more generic way to do this [...?] } } We only have to handle builtins that can potentially block } indefinitely, right? Well ... there's the "command1 | builtin ; command2" thing where interrupt kills command1 but not builtin, causing builtin to exit on EOF and thereby allowing command2 to run. Ideally the interrupt would affect command2 as well. If builtin is a loop or other construct this already works, so the questions are (1) can any other builtins be used in a pipe, and (2) can any syntactic construct other than a pipeline produce the same effect. Given that modules can do just about anything they want, the answer to (1) is "yes" even if there's currently no example ... However, that doesn't affect 3.0.8, so I think I'm going to go ahead with 11461 for that release (unless somebody hollers today to stop me). -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com