zsh-users
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: Ivan Brkanac <ibrkanac@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: $terminfo for up and down arow
Date: Wed, 08 Jan 2014 09:55:40 +0100	[thread overview]
Message-ID: <874n5eyhrn.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <CALRKU=Gv_VELAq9JGg3se_ne8Kn4+GdTS6SJD7FtN2mghPA6ag@mail.gmail.com> (Ivan Brkanac's message of "Wed, 8 Jan 2014 09:33:06 +0100")

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


  reply	other threads:[~2014-01-08  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08  8:33 Ivan Brkanac
2014-01-08  8:55 ` Frank Terbeck [this message]
2014-01-08  9:38   ` Frank Terbeck
2014-01-10 12:38     ` Ivan Brkanac
2014-01-10 12:48       ` Peter Stephenson

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=874n5eyhrn.fsf@ft.bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=ibrkanac@gmail.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).