From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3483 invoked by alias); 28 Feb 2017 21:16:32 -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: 22519 Received: (qmail 4213 invoked from network); 28 Feb 2017 21:16:32 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net 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(205.235.26.22):SA:0(0.5/5.0):. Processed in 0.489854 secs); 28 Feb 2017 21:16:32 -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.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=4aaf=2J=brasslantern.com=schaefer@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at bounces.park01.gkg.net does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=NVGKRiBdsayJa2Vf8dQnbEMsrqtgAA0xh/k9Jg7VS3w=; b=x4qJY9Mqpm0ugymemHlkwzfbQZ/NvwdvVyYtx7c70IoXrjfNO2cii1D6c6ytVem+tp cRHJ9O2KjJPgLdhmGnG0soWrpzl5pvipvM5nrdeU/3eQ4lmxr4W85SRtEFB7d7KKfsEn r+gyQXOCUH0mXZkS2FBliRj0EGoH5mSi/Leplz9WBXb4i/QcsGuH3mxKNwfZcldO69cT nqUyYAqFIHQS24h0CFWEsgJBj21SeqBSuIP9T7UpEVugSzUpcqPs1vV2ZtcXM7S56zEZ 2+UGDNx1hk7qOfrw0i3gjGOwpq7TSqAnv+QZmoLuuLpPBuFHajF8masMzV6tCRlcDSGN Gyog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=NVGKRiBdsayJa2Vf8dQnbEMsrqtgAA0xh/k9Jg7VS3w=; b=mVpYIM/CdPmEO6FOoaxqzDnFJEocexx5/K4r/AH/KBfl29eagQx0R0L5IZCAySYKCh wuSOWRM58OsWvrVVZMtXang75FsXvRd6fL4GDWN8MrsipgUwqhqCb/Um29Voggo+Zcw2 HKmG/bSh/CMG04pv/46lAfF8xnvOMEjW+yrlMIaObBS15m+ejYRhNTYsyHCSpLFRVFeg /mVaNCS12gwSPdtVzpHBQjRS/sxk8p3ykFV9UlmxrRwMI3glKL7eu17M9hApTNpxQ5ae a1UfAfjKUwqLBVQeCa3Um+otl5VIIKhr9QVC1xYrYswmZM653VE0p4HVluTHYRjIzI95 CnQg== X-Gm-Message-State: AMke39kkY+Y6MahdHE4dE5XfTYW5qpSjjSYbpHU5cBd1U8vO1fjYHx4xbXbHZbSTMJOhVQ== X-Received: by 10.176.74.146 with SMTP id s18mr2099327uae.65.1488316563485; Tue, 28 Feb 2017 13:16:03 -0800 (PST) From: Bart Schaefer Message-Id: <170228131618.ZM8208@torch.brasslantern.com> Date: Tue, 28 Feb 2017 13:16:18 -0800 In-Reply-To: <1488277394.2867401.895300784.0A2F382A@webmail.messagingengine.com> Comments: In reply to Sebastian Gniazdowski "Problem with early key strokes at startup" (Feb 28, 2:23am) References: <1488277394.2867401.895300784.0A2F382A@webmail.messagingengine.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Sebastian Gniazdowski , zsh-users@zsh.org Subject: Re: Problem with early key strokes at startup MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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. 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*. If this is a new shell being spawned by an already-running zsh, you can try playing around with the value of the STTY environment variable to disable some of the special tty driver settings ahead of time (see the zsh manual for how STTY works). If it's not zsh you'll have to figure out a different way to frob the driver -- and either way I do not promise it'll work.