zsh-users
 help / color / mirror / code / Atom feed
From: Andrew Janke <floss@apjanke.net>
To: zsh-users@zsh.org
Subject: Best practice for smkx and ZLE?
Date: Tue, 9 Feb 2016 05:07:06 -0500	[thread overview]
Message-ID: <56B9BA4A.30805@apjanke.net> (raw)

Hi, Zsh folks,

Is there a consensus in the Zsh community about whether we should generally
be using smkx/rmkx in zle-line-init/finish to switch in to application
keypad mode when ZLE is active? And if so, where it's best to configure
this - i.e. in system-wide /etc/z* files vs. individual user's ~/.zshrc?

I've run in to this a few times working with my own config files and with
Oh My Zsh, and am wondering whether the generally accepted thing is
to do so at this point.

On the upside, doing `smkx` means you can use the terminfo entries to
portably get the character sequences for the arrow and home/end keys.

On the downside:

  - zle_line_init() doesn't compose easily (like $precmd_functions and other
    multi hooks do), so one init file's definition can clobber another's,
    and whoever defines the effective zle_line_init must include it.
  - smkx (usually) puts both the cursor and numeric keypads in to 
application mode.
    There's no default binding for the sequences emitted by the numeric
    keypad in app mode, so using it gives you junk on the command line,
    instead of numbers.
  - Among smaller terminal emulators, there's more variability in behavior
    in application mode than in normal mode. E.g. some don't change Home
    and End behavior while in cursor application mode, or respect smkx
    at all, though they still set $TERM to 'xterm'. But their normal mode
    behavior tends to match xterm's. So terminfo-based
    cursor key bindings may end up being less portable in practice.

There've been a few discussions about it on this list with respect to
particular problems.

http://www.zsh.org/mla/users//2010/msg00065.html
http://www.zsh.org/mla/users//2014/msg00567.html
http://www.zsh.org/mla/users//2014/msg00030.html

But I don't know if there's general consensus, and I haven't seen
anything in the Zsh reference manual or other documentation
recommending it for general use. Any conclusions on this?

Cheers,
Andrew Janke


             reply	other threads:[~2016-02-09 10:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 10:07 Andrew Janke [this message]
2016-02-09 15:58 ` Bart Schaefer

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=56B9BA4A.30805@apjanke.net \
    --to=floss@apjanke.net \
    --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).