From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23822 invoked by alias); 8 Jan 2014 09:19:56 -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: 18293 Received: (qmail 13992 invoked from network); 8 Jan 2014 09:19:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 From: Frank Terbeck To: Ivan Brkanac Cc: zsh-users@zsh.org Subject: Re: $terminfo for up and down arow In-Reply-To: (Ivan Brkanac's message of "Wed, 8 Jan 2014 09:33:06 +0100") References: User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) Organisation: 63797068657270756e6b Date: Wed, 08 Jan 2014 09:55:40 +0100 Message-ID: <874n5eyhrn.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: NDMwNDQ0 Ivan Brkanac wrote: > as from zsh 5.0.3 and till 5.0.5 there is some change in up and down > arrow as reported by "$terminfo[kcuu1]" and "$terminfo[kcud1]" it > reports ^[OB and ^[OA on os x 10.9.1 and zsh from homebrew corect > sequence is '^[[B' and '^[[A'. The correct values largely depend on the value of $TERM. For example, with $TERM := screen, the correct value is "^[OA". What might be confusing you, is the fact that the values from $terminfo are _only_ valid in "keyboard-transmit-mode". That's the mode you enter, by issuing "smkx" and you leave by "rmkx" (see terminfo(5)). Zsh's line editor (zle), does not do this by default, but it can by made to do that, when it is active. One caveat to note is, that not all terminals _have_ an explicit "smkx" mode (they just default to being in "keyboard-transmit-mode" all the time), so you need to check for the ability of the terminal before trying to use it: zle-line-init () { (( ${+terminfo[smkx]} )) && echoti smkx } zle-line-finish () { (( ${+terminfo[rmkx]} )) && echoti rmkx } Regards, Frank