Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $terminfo for up and down arow
- X-seq: zsh-users 18293
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Ivan Brkanac <ibrkanac@xxxxxxxxx>
- Subject: Re: $terminfo for up and down arow
- Date: Wed, 08 Jan 2014 09:55:40 +0100
- Cc: zsh-users@xxxxxxx
- In-reply-to: <CALRKU=Gv_VELAq9JGg3se_ne8Kn4+GdTS6SJD7FtN2mghPA6ag@mail.gmail.com> (Ivan Brkanac's message of "Wed, 8 Jan 2014 09:33:06 +0100")
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organisation: 63797068657270756e6b
- References: <CALRKU=Gv_VELAq9JGg3se_ne8Kn4+GdTS6SJD7FtN2mghPA6ag@mail.gmail.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author