zsh-users
 help / color / mirror / code / Atom feed
* Best practice for smkx and ZLE?
@ 2016-02-09 10:07 Andrew Janke
  2016-02-09 15:58 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Janke @ 2016-02-09 10:07 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Best practice for smkx and ZLE?
  2016-02-09 10:07 Best practice for smkx and ZLE? Andrew Janke
@ 2016-02-09 15:58 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2016-02-09 15:58 UTC (permalink / raw)
  To: zsh-users

On Feb 9,  5:07am, Andrew Janke wrote:
}
} 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?

I would have to say "no, there is not."

Also you might get three different answers depending on whether you ask
here, or on IRC, or among omz users.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-09 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-09 10:07 Best practice for smkx and ZLE? Andrew Janke
2016-02-09 15:58 ` Bart Schaefer

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).