From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24814 invoked by alias); 1 Mar 2017 06:35:22 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22520 Received: (qmail 24242 invoked from network); 1 Mar 2017 06:35:22 -0000 X-Qmail-Scanner-Diagnostics: from new1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.221):SA:0(-0.4/5.0):. Processed in 2.700841 secs); 01 Mar 2017 06:35:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint3@fastmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 66.111.4.221 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=hbrgXrjSKI+sGVBUcXb17HWFjw E=; b=qQEM/7DhhtmdFJQWp3uJHxrL6ekSM0Pq/YC1Jp8eOHaBQGx/40tlDw+ZKT ReqdYHZhSjhYoyakT7WogJLK5J8xpKAEfRUewH2092tC9z12MdUCqwz20f4BkbM8 lSC1J3Fr7d337f6vFlXXZ9CI5DPRW0vLR5XAayypdByZIuk2M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=smtpout; bh=hb rgXrjSKI+sGVBUcXb17HWFjwE=; b=DYf2F892u0LdBsYdvZOs5GaiBdRbDwAsUX u89xppo+jJHrrHnE0/vdqYg9A7WhCuYucWpH8q/Q6frPZQ55F83dwP/fRHZWun6q CY4eNB6j6ELWE/8ek+V4fzK3XEzcE/jcHHZAY2YMLufkikbIjdTZfUX6nO5BwRNm HH3QP3ypE= X-ME-Sender: Message-Id: <1488349687.2058100.896435600.395A6073@webmail.messagingengine.com> From: Sebastian Gniazdowski To: Bart Schaefer , zsh-users@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-715c2c0c Date: Tue, 28 Feb 2017 22:28:07 -0800 In-Reply-To: <170228131618.ZM8208@torch.brasslantern.com> References: <1488277394.2867401.895300784.0A2F382A@webmail.messagingengine.com> <170228131618.ZM8208@torch.brasslantern.com> Subject: Re: Problem with early key strokes at startup 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 = ; dsusp = ; eof = ^D; eol = ; eol2 = ; erase = ^?; intr = ^C; kill = ^U; lnext = ; min = 1; quit = ; reprint = ^R; start = ^Q; status = ^T; stop = ^S; susp = ; time = 0; werase = ^W; -- Sebastian Gniazdowski psprint3@fastmail.com