zsh-workers
 help / color / mirror / code / Atom feed
* RE: Debug / cut'n'paste on IRIX
@ 1999-03-12  9:40 Andrej Borsenkow
  0 siblings, 0 replies; 6+ messages in thread
From: Andrej Borsenkow @ 1999-03-12  9:40 UTC (permalink / raw)
  To: Helmut Jarausch, zsh-workers


> 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


^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: Debug / cut'n'paste on IRIX
@ 1999-03-12 10:21 Andrej Borsenkow
  1999-03-12 10:34 ` Peter Stephenson
  1999-03-12 14:33 ` Geoff Wing
  0 siblings, 2 replies; 6+ messages in thread
From: Andrej Borsenkow @ 1999-03-12 10:21 UTC (permalink / raw)
  To: Helmut Jarausch, zsh-workers

[I am sorry for all these mails]

>
> that's what happens. I could not find the relevant part in
> sources - anybody (Geoff) - could you get a look:
>
> 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.
>


Looks, like it is done in settyinfo(), that is (unconditionally) called from
trashzle() that is called from zleread() after we've seen new line. (It is
actually using tcsetattr() on our system)

Fixing it is probably not trivial. Currently, the only place where FIONREAD
is used is setupterm(). If we find typeahed, we avoid calling sttyinfo() at
all. May be, we should come up with a single function that checks for
typeahead, reads it in buffer and changes tty modes after that?

And I wonder, if this is all ... We already had (still unresolved) case with
read -q ...

/andrej


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Debug / cut'n'paste on IRIX
@ 1999-03-12  9:04 Helmut Jarausch
  1999-03-12  9:20 ` Andrej Borsenkow
  0 siblings, 1 reply; 6+ messages in thread
From: Helmut Jarausch @ 1999-03-12  9:04 UTC (permalink / raw)
  To: zsh-workers

Thanks to all for your hints on debugging ZSH. It worked great.

Still, as every real bug, it didn't show up when stepping slowly through
the code.

Several tries with a normal zsh (full speed) show that even than
sometime it works just fine but then again it looses some of the input
when this comes at high speed as is true when it comes via cut'n'paste.

So, it looks to me like an 'overrun' but on an XTerm which should be
really fast.

Unfortunately I have no idea about the technicalities of terminal I/O
so I have to give up.

Sorry for the bad news,
Helmut.






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-03-12 14:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-12  9:40 Debug / cut'n'paste on IRIX Andrej Borsenkow
  -- strict thread matches above, loose matches on Subject: below --
1999-03-12 10:21 Andrej Borsenkow
1999-03-12 10:34 ` Peter Stephenson
1999-03-12 14:33 ` Geoff Wing
1999-03-12  9:04 Helmut Jarausch
1999-03-12  9:20 ` Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).