Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: pasting

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

Messages sorted by: Reverse Date, Date, Thread, Author