From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20569 invoked from network); 18 May 2000 08:38:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 May 2000 08:38:08 -0000 Received: (qmail 1646 invoked by alias); 18 May 2000 08:37:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11454 Received: (qmail 1636 invoked from network); 18 May 2000 08:37:58 -0000 Date: Thu, 18 May 2000 10:37:19 +0200 (MET DST) Message-Id: <200005180837.KAA02231@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Thu, 18 May 2000 06:55:46 +0000 Subject: Re: suspend while loop. Bart Schaefer wrote: > On May 16, 12:02pm, Bart Schaefer wrote: > } Subject: Re: suspend while loop. > } > } > Z(4):akr@serein% Src/zsh -f > } > serein% cat |while read line; do echo $line; done > } > > } > > } > `cat' is suspended. But zsh wait something yet... > } > } I think you can't break out of `read' with ^Z. Try it without the cat| > } and you'll find you can't suspend the loop. > > Does anyone have any insights on this? I was about to announce 3.0.8, > but discovered that this loop is not suspendable there either. I don't > have much time for debugging it myself this week ... > > If it doesn't appear to be easily fixed, I'm going to go ahead and put > 3.0.8 out anyway. I can't see how we could (really) make in suspendible. For that we would need to be able to get out of the read, back to the place where we can create the sub-shell for the loop. Then, on continuing, we would need to be able to go into the same read and continue with it. But the first thing can only be done by returing from the read. Everyone can easily test this by adding child_unblock() before the read() in zread() and child_unblock()s after it. This makes the loop suspendible, but when it is continued, the loop exits immediately because the read that was suspended returned non-zero. Depending on personal taste it is either ugly that the cat gets suspended or that we can't ^C out of the loop after the ^Z. I've no idea how to solve this. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de