zsh-workers
 help / color / mirror / code / Atom feed
* pasting
@ 2015-04-04  3:30 Dave Yost
  2015-04-04 17:54 ` pasting Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Yost @ 2015-04-04  3:30 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

This is what happens when I paste three commands into OS X Terminal
0 Fri 20:24:39 yost DaveBook ~
303 Z% echo 1
1
echo 2                                                                                                                                     
echo 3
0 Fri 20:24:55 yost DaveBook ~
304 Z% echo 2
2
0 Fri 20:24:55 yost DaveBook ~
305 Z% echo 3
3
0 Fri 20:24:55 yost DaveBook ~
306 Z% echo $ZSH_VERSION 
5.0.7
0 Fri 20:29:54 yost DaveBook ~
307 Z% 

Why doesn’t it look like this?
0 Fri 20:24:39 yost DaveBook ~
303 Z% echo 1
1
0 Fri 20:24:55 yost DaveBook ~
304 Z% echo 2
2
0 Fri 20:24:55 yost DaveBook ~
305 Z% echo 3
3
0 Fri 20:24:55 yost DaveBook ~
306 Z% 

Hmm, I guess it’s not Terminal’s fault.
127 Fri 20:26:28 yost  ~
509 BASH $ echo 1
1
0 Fri 20:26:49 yost  ~
510 BASH $ echo 2
2
0 Fri 20:26:49 yost  ~
511 BASH $ echo 3
3
0 Fri 20:26:49 yost  ~
512 BASH $ echo $BASH_VERSION
3.2.57(1)-release
0 Fri 20:29:21 yost  ~
513 BASH $ 



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

* Re: pasting
  2015-04-04  3:30 pasting Dave Yost
@ 2015-04-04 17:54 ` Bart Schaefer
  2015-04-05  6:24   ` pasting Jun T.
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2015-04-04 17:54 UTC (permalink / raw)
  To: zsh-workers

On Apr 3,  8:30pm, Dave Yost wrote:
} 
} This is what happens when I paste three commands into OS X Terminal

I can't reproduce this on Linux.  I also can't reproduce it when ssh'd
in to MacOS, so it does have *something* to do with the input drivers.

I believe you're seeing a side-effect of a bug workaround:  On some
platforms, changing the TTY modes the way zsh does when entering the
line editor causes typeahead to be discarded.  Rather than cause that
input to be lost, zsh allows it to be processed by the lower-level
drivers before reprinting the prompt.

The set of available tty flags detected on OS X seems to match those
on platforms that require this workaround.  It could be that we can
#ifdef around this; it'd be in one of zsetterm() or raw_getbyte() in
Src/Zle/zle_main.c, I think (possibly both).

Unfortunately there are as usual for the older code, no comments to say
exactly which bits of code are doing this trick.  There *are* comments
mentioning looking for typeahead so that we have a chance to instantly
process interrupts in case of e.g. runaway output, so I may be wrong
about all of the foregoing.

-- 
Barton E. Schaefer


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

* Re: pasting
  2015-04-04 17:54 ` pasting Bart Schaefer
@ 2015-04-05  6:24   ` Jun T.
  2015-04-05 15:44     ` pasting Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Jun T. @ 2015-04-05  6:24 UTC (permalink / raw)
  To: zsh-workers

I can reproduce this on my Mac with zsh-5.0.7 (or 5.0.2 which is
preinstalled by Apple), but not with the latest git master.

It seems the problem has been fixed by

commit 40c5e00de09066916ef42067ae21e58a5268c647
Author: Oliver Kiddle <opk@zsh.org>
Date:   Sun Nov 30 23:26:17 2014 +0100

    33800: remove old workaround for ancient systems to
    consume typeahead before setting up the terminal


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

* Re: pasting
  2015-04-05  6:24   ` pasting Jun T.
@ 2015-04-05 15:44     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2015-04-05 15:44 UTC (permalink / raw)
  To: zsh-workers

On Apr 5,  3:24pm, Jun T. wrote:
}
} It seems the problem has been fixed by
} 
}     33800: remove old workaround for ancient systems to
}     consume typeahead before setting up the terminal

(Hand smacks forehead)

I'd forgotten about that.  I searched "typeahead" in the code but not
in the change history.


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

end of thread, other threads:[~2015-04-05 15:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-04  3:30 pasting Dave Yost
2015-04-04 17:54 ` pasting Bart Schaefer
2015-04-05  6:24   ` pasting Jun T.
2015-04-05 15:44     ` pasting Bart Schaefer

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).