I'm using terminfo
to find out what they control sequence is for the Left (Right, ...) key in my terminal, so that I can then map it to something useful (move left) in my zshrc
like this:
typeset -A key
left=${terminfo[kcub1]}
bindkey "$left" backward-char
(there's some other things to get this to work, see source).
This is helpful because I use several terminal emulators and these control sequences change. e.g. I use Gnome Terminal on Ubuntu to ssh
to a Debian box and then to use tmux
inside that...
But how can I find out the key codes for the CTRL+LEFT (and RIGHT...) from terminfo? I'd like to map these to word left/right.