From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18627 invoked from network); 23 May 2000 15:45:30 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 May 2000 15:45:30 -0000 Received: (qmail 4963 invoked by alias); 23 May 2000 15:45:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11538 Received: (qmail 4956 invoked from network); 23 May 2000 15:45:13 -0000 From: "Bart Schaefer" Message-Id: <1000523154455.ZM1095@candle.brasslantern.com> Date: Tue, 23 May 2000 15:44:54 +0000 In-Reply-To: <200005230831.KAA23545@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "PATCH: Re: Segmentation fault 3.1.7-pre-3/4" (May 23, 10:31am) References: <200005230831.KAA23545@beta.informatik.hu-berlin.de> <0FV000FFM9H4SI@la-la.cambridgesiliconradio.com> In-Reply-To: <0FV000FFM9H4SI@la-la.cambridgesiliconradio.com> Comments: In reply to Peter Stephenson "Re: PATCH: Re: Segmentation fault 3.1.7-pre-3/4" (May 23, 10:10am) X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.auc.dk, Peter Stephenson Subject: Re: PATCH: Re: Segmentation fault 3.1.7-pre-3/4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 23, 10:31am, Sven Wischnowsky wrote: } Subject: PATCH: Re: Segmentation fault 3.1.7-pre-3/4 } } Bernd Eggink wrote: } } > This gives a seg fault if executed in a script: } > } > read -q "REPLY?hm: " } > } > Happens with pre-3 and pre-4, not with pre-1. } } Oh, look Bart, there's the reason to not always use shout (11036). Hmm, why did I think that SHTTY != -1 mean that shout was nonzero? I personally would prefer the following patch, but I haven't committed it yet. Index: builtin.c =================================================================== @@ -4970,6 +4970,10 @@ oshout = shout; init_shout(); } + } else if (!shout) { + haso = 1; + oshout = shout; + init_shout(); } /* We should have a SHTTY opened by now. */ if (SHTTY == -1) { On May 23, 10:10am, Peter Stephenson wrote: } Subject: Re: PATCH: Re: Segmentation fault 3.1.7-pre-3/4 } } Sven wrote } > But with zle not loaded, the } > } > zsh -c "read -q '?Can you see this? '" < /dev/null >& /dev/null } > } > from 11036 doesn't show the prompt (but at least it doesn't segv } > anymore). Is it right or wrong? Do we have to work around it? } } Seems to me that after doing your damnedest *not* to have the prompt shown, } you don't want it. `read -q' is documented as always reading from } the terminal, and the prompt as printing on stderr. I haven't checked } that's what's actually going on, but it's consistent. It's confusing. If I've written a script and embedded a "read -q" in it somewhere, chances are I expect it to display the prompt and not just hang mysteriously until the user happens to touch the keyboard. It should not be necessary to always write something like [[ -t 2 ]] && read -q '?Can you see this? ' 2>/dev/tty because the shell knows much better than I do whether there *is* a tty. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com