From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4077 invoked from network); 17 Feb 2008 17:24:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Feb 2008 17:24:11 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 66575 invoked from network); 17 Feb 2008 17:24:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Feb 2008 17:24:07 -0000 Received: (qmail 11642 invoked by alias); 17 Feb 2008 17:24:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24565 Received: (qmail 11615 invoked from network); 17 Feb 2008 17:24:01 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 17 Feb 2008 17:24:01 -0000 Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bifrost.dotsrc.org (Postfix) with ESMTP id 19BED8026E0B for ; Sun, 17 Feb 2008 18:23:58 +0100 (CET) Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20080217172548.DNEW16169.mtaout01-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Sun, 17 Feb 2008 17:25:48 +0000 Received: from pws-pc ([81.107.42.63]) by aamtaout02-winn.ispmail.ntl.com with ESMTP id <20080217172519.HQJJ17393.aamtaout02-winn.ispmail.ntl.com@pws-pc> for ; Sun, 17 Feb 2008 17:25:19 +0000 Date: Sun, 17 Feb 2008 17:22:25 +0000 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: read -s doesn't work with -t? Message-ID: <20080217172225.1d8a8e4e@pws-pc> In-Reply-To: <080216093755.ZM17001@torch.brasslantern.com> References: <237967ef0802151327q1c6d3a19oa67a977b82c52f67@mail.gmail.com> <080215191216.ZM29994@torch.brasslantern.com> <237967ef0802152333g7f759674r806f61f9f76f86f2@mail.gmail.com> <237967ef0802152350i1fec3369oba9268400a209b2e@mail.gmail.com> <080216093755.ZM17001@torch.brasslantern.com> X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=Rw7lO6RaNG4A:15 a=3FTp5y5X6ml6ZCsPBftHHg==:17 a=NLZqzBF-AAAA:8 a=tDiNodcV2CqE3npTQUYA:9 a=iLm1v0brjidG1Hl5aFJh8vCcuS8A:4 a=I6wTmPyJxzYA:10 a=_dQi-Dcv4p4A:10 a=ab-cVblaaOsA:10 X-Virus-Scanned: ClamAV 0.91.2/5847/Sun Feb 17 12:26:12 2008 on bifrost X-Virus-Status: Clean (I've moved this to zsh-workers since this is involved enough even for developers.) On Sat, 16 Feb 2008 09:37:53 -0800 Bart Schaefer wrote: > It also seems to me that canonical input mode should be set and the > prompt should be printed before the read-timeout poll is done, so -d > should come before -t as well. However, I'm not really sure what's > going on with shttyinfo versus saveti, so I'm not going to commit the > following until somebody else checks it over. It's not obvious to me quite what the difference is, and I suspect that if bin_read() hadn't grown quite so organically (this is not a term of approbation) it would me more obvious that they could be combined. I suspect it's just the fact that the -s and -d code has been written differently from the -k code. The latter assumes it's a good idea to keep the normal shell state (shttyinfo) in sync; this is complicated by the fact that in non-interactive usage we have to set up shttyinfo if it wasn't already. The former assumes it should just alter the current settings and restore them to what they were afterwards. The whole thing is further complicated by the fact that we (I've certainly mucked around with it, too) do different things depending on additional options to -k. This is just a hypothesis. To be honest, I can't really follow all the ins and outs and if your patch works (checking -k in combination with other options is probably the key) it's probably good enough and we can see if problems turn up as time passes. It would be nice to have tests but they're particularly difficult to write for this. > And of course there may be some kind of bad interaction between changing > the tty state and reading typeahead that I'm not aware of that makes all > this impossible, in which case it should just be documented that you > can't use a prompt or -s or -d in combination with -t. With a bit of luck, weird interactions of this kind may be just a bad memory now... I've a vague memory Ultrix came into it. I don't think we ever deliberately attempted to handle this outside zle, in any case, but I could be wrong. Certainly the word "typeahead", with or without a hyphen, only seems to occur in Zle (and input.c where we're about to call Zle.) > That thread just sort of died without resolution because PWS can't > reproduce the problem. I suspect that was more to do with the fact that the xterm stuff wasn't doing the right thing for me rather than that the shell *was* doing the right thing, but I never really got to the bottom of it. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/