From: Sebastian Gniazdowski <psprint3@fastmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>, zsh-users@zsh.org
Subject: Re: Problem with early key strokes at startup
Date: Tue, 28 Feb 2017 22:28:07 -0800 [thread overview]
Message-ID: <1488349687.2058100.896435600.395A6073@webmail.messagingengine.com> (raw)
In-Reply-To: <170228131618.ZM8208@torch.brasslantern.com>
On Tue, Feb 28, 2017, at 01:16 PM, Bart Schaefer wrote:
> On Feb 28, 2:23am, Sebastian Gniazdowski wrote:
> }
> } when I startup zsh to just run a tool with Ctrl-O Ctrl-P, I get "^P" or
> } "^O^P" printed instead:
> }
> } Maybe it's easy to fix?
>
> Unfortunately not. Typeahead (characters present on stdin before the
> shell is ready to read them) is exceptionally difficult to deal with
> in a portable way. There are several lengthy comments about this in
> the C code in shell startup and zle.
I'm thinking about some minimum effort try. Looked for some
initialization via "ack stty\|STTY" but didn't find it. Would move/copy
it earlier to main, that's all. Maybe it's even the case that needed
initialization is in zle module, it would fire little late then
probably.
> In this specific case, the problem is likely ctrl-O. If you look at
> output of "stty -a" you'll probably find ^O bound to something called
> "flush" which is annoyingly undocumented but means to throw away all
> previous input that has not already been read by whatever is connected
> to the TTY device. This is likely being seen and intepreted by the
> terminal driver before zsh has a chance to change the state to "raw"
> input, and there's absolutely nothing we can do about *that*.
I have:
cchars: discard = <undef>; dsusp = <undef>; eof = ^D; eol = <undef>;
eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U;
lnext = <undef>; min = 1; quit = <undef>; reprint = ^R;
start = ^Q; status = ^T; stop = ^S; susp = <undef>; time = 0;
werase = ^W;
--
Sebastian Gniazdowski
psprint3@fastmail.com
prev parent reply other threads:[~2017-03-01 6:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 10:23 Sebastian Gniazdowski
2017-02-28 21:16 ` Bart Schaefer
2017-03-01 6:28 ` Sebastian Gniazdowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1488349687.2058100.896435600.395A6073@webmail.messagingengine.com \
--to=psprint3@fastmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).