From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7458 invoked from network); 1 May 2000 02:52:41 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 May 2000 02:52:41 -0000 Received: (qmail 27495 invoked by alias); 1 May 2000 02:52:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11036 Received: (qmail 27467 invoked from network); 1 May 2000 02:52:32 -0000 From: "Bart Schaefer" Message-Id: <1000501025227.ZM5370@candle.brasslantern.com> Date: Mon, 1 May 2000 02:52:27 +0000 References: <390793BB.1CF0@u.genie.co.uk> <1000427092306.ZM21039@candle.brasslantern.com> <3909B387.7E0C@u.genie.co.uk> <1000430164555.ZM4708@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh hackers list Subject: Re: 3.1.7-pre-2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 30, 4:45pm, Bart Schaefer wrote: } Subject: Re: 3.1.7-pre-1 for the workers } } I have a couple of issues that came up after the prerelease to resolve. } } The "read -q" bug that Sven patched in 10727. So ... 10727 makes this work: zsh -c "read -q '?Can you see this? '" < /dev/null But the following still sends the prompt to the redirected stderr, which seems wrong to me: zsh -c "read -q '?Can you see this? '" < /dev/null >& /dev/null The goal is to read from the tty only after also prompting there. Patch follows for consideration; I have not committed it, pending commentary. The first hunk is the interesting one: It seems to me there's never any longer a reason to send the prompt to stderr, but I may be missing some case where ZLE is active and yet SHTTY == -1. (?) The other two hunks just avoid a redundant close(). Index: Src/builtin.c =================================================================== RCS file: /extra/cvsroot/zsh/zsh-3.1/Src/builtin.c,v retrieving revision 1.86 diff -u -r1.86 builtin.c --- builtin.c 2000/04/30 18:54:07 1.86 +++ builtin.c 2000/05/01 02:32:28 @@ -3420,8 +3420,8 @@ *readpmpt && *readpmpt != '?'; readpmpt++); if (*readpmpt++) { if (keys || isatty(0)) { - zputs(readpmpt, (haso ? shout : stderr)); - fflush(haso ? shout : stderr); + zputs(readpmpt, shout); + fflush(shout); } readpmpt[-1] = '\0'; } @@ -3461,8 +3461,7 @@ else settyinfo(&shttyinfo); if (haso) { - close(SHTTY); - fclose(shout); + fclose(shout); /* close(SHTTY) */ shout = oshout; SHTTY = -1; } @@ -3494,8 +3493,7 @@ /* dispose of result appropriately, etc. */ if (haso) { - close(SHTTY); - fclose(shout); + fclose(shout); /* close(SHTTY) */ shout = oshout; SHTTY = -1; } -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com