zsh-users
 help / color / mirror / code / Atom feed
* Strange problem with bindkey keys passing through to apps
@ 2018-09-14 11:38 David Woodfall
  2018-09-14 12:43 ` Daniel Shahaf
  0 siblings, 1 reply; 6+ messages in thread
From: David Woodfall @ 2018-09-14 11:38 UTC (permalink / raw)
  To: Zsh Users

I have setup a bind to make a printf code to switch to previous
console. For screen some extra escapes are needed. This is in a plain
linux console, not in an xterm type of terminal.

The binds work fine except when I try to use them while running an
app - e.g. weechat, mutt - they fail and e.g. mutt will see it as the
bind to save the mail.

It seems that zsh isn't grabbing the keys for some reason and they
are falling through to the apps.

This is what my test and function look like:

if [ "$TERM" = "linux" ]; then
  zle -N _prev_cons
  _prev_cons() {
    printf '\e[15]'
  }

  bindkey -M viins "^[s"    _prev_cons
  bindkey -M vicmd "^[s"    _prev_cons
elif [[ $TERM =~ screen ]]; then
  zle -N _prev_cons
  _prev_cons() {
    printf '\eP\e[15]\e\\'
  }

  bindkey -M viins "^[s"    _prev_cons
  bindkey -M vicmd "^[s"    _prev_cons
fi

bindkey -L | grep _prev_cons shows them to exist.

Any ideas why these are passing through to apps and not grabbed by the shell?

-Dave

--

Linux is obsolete
  -- Andrew Tanenbaum

                                                            .--.  oo
                                                           (____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

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

end of thread, other threads:[~2018-09-14 13:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-14 11:38 Strange problem with bindkey keys passing through to apps David Woodfall
2018-09-14 12:43 ` Daniel Shahaf
     [not found]   ` <1536929114.231186.1508076776.2D392EA0@webmail.messagingengine.com>
2018-09-14 13:13     ` David Woodfall
2018-09-14 13:19       ` David Woodfall
2018-09-14 13:20       ` Daniel Shahaf
2018-09-14 13:23         ` David Woodfall

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