From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1526 invoked from network); 12 Mar 1999 09:43:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Mar 1999 09:43:15 -0000 Received: (qmail 12147 invoked by alias); 12 Mar 1999 09:42:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5771 Received: (qmail 12138 invoked from network); 12 Mar 1999 09:42:41 -0000 From: "Andrej Borsenkow" To: "Helmut Jarausch" , Subject: RE: Debug / cut'n'paste on IRIX Date: Fri, 12 Mar 1999 12:40:57 +0300 Message-ID: <000f01be6c6c$6e4388a0$21c9ca95@mowp.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 > Aha! This sounds the hell like FIONREAD problem (typeahed is lost). > > Folks, what happens, when ZSH outputs PS2? What I mean is: > > if I simply have typeahead and ZSH returns to PS1, it (if > configured - my case) explicitly uses FIONREAD to check for > typeahead before changing tty modes. > > Does it do the same for PS2? Does it change tty modes in this > case? If yes, is it using FIONREAD? > that's what happens. I could not find the relevatnt part in sources - anybody (Geoff) - could you get a look: This was for for i in 1 2 3 4 5 do bla bla bla done Cut'n'pasted in another shell. As you see, after it gets first new line it does ioctl(10, TCSETSW,...) before PS2, that, unfortunately, throughs away all pending input :-( The following FIONREAD is useless in this case. 9845: read(10, " 5", 1) = 1 9845: write(10, " 5", 1) = 1 9845: read(10, "\n", 1) = 1 9845: poll(0x000000FFFFFEC768, 1, 0) = 1 9845: write(10, "\r\n", 2) = 2 9845: ioctl(10, TCGETA, 0x000000FFFFFEE6E4) = 0 9845: ioctl(10, TCSETSW, 0x00000000004C1620) = 0 9845: alarm(0) = 0 9845: sigaction(SIGINT, 0x000000FFFFFEE528, 0x0000000000000000) = 0 9845: ioctl(10, FIONREAD, 0x000000FFFFFEE454) = 0 9845: ioctl(10, TIOCGSID, 0x000000FFFFFEE394) = 0 9845: getsid(0) = 7682 9845: ioctl(10, TIOCSPGRP, 0x000000FFFFFEE3DC) = 0 9845: ioctl(10, TCGETA, 0x000000FFFFFEE394) = 0 9845: ioctl(10, TCSETSW, 0x000000FFFFFEE458) = 0 9845: write(10, 0x00000000004BC8C0, 26) = 26 9845: \r1B [ 0 m1B [ 2 2 ; 2 7 m1B [ 2 4 m1B [ J f o r > 9845: write(10, "1B [ K", 3) = 3 9845: read(10, 0x000000FFFFFEE474, 1) (sleeping...) 9