Steven Lu
2014-10-12 14:11:40 UTC
I have many traditionally unsupported key combinations that I would like to
use which are not supported by traditional terminal emulators. I tend to
use either a custom build of PuTTY on Windows or iTerm2 on OS X, which both
allow me to send arbitrary byte patterns based on keystrokes. iTerm2 is
obviously easier to configure as it has a UI for this, for PuTTY I actually
just hardcode them in.
Anyways, the only viable way that I've found so far to get these keys to
work as custom tmux binds are to load them in as unused keys that tmux is
designed to recognize. According to the manpage:
tmux allows a command to be bound to most keys, with or without a prefix
key. When specifying keys, most represent themselves (for example `A' to
`Z'). Ctrl keys may be prefixed with `C-' or `^', and Alt (meta) with
`M-'. In addition, the following special key names are accepted: Up, Down,
Left, Right, BSpace, BTab, DC (Delete), End, Enter, Escape, F1 to F20,
Home, IC (Insert), NPage/PageDown/PgDn, PPage/PageUp/PgUp, Space, and Tab.
Basically the only keys in this set that remain unused on a modern keyboard
are the F13 thru F20 keys.
So far I have consumed 3 of these mappings (for various powerful caps lock
key based shenanigans), but I am looking to add 4 more mappings (for being
triggered by Alt+Shift+H/J/K/L -- as far as I can tell, key combinations
like this as well as others like Ctrl+number keys, just aren't supported).
At this point F14-F20 are used up and this leaves me with precious little
left.
The way that I let tmux recognize my custom terminal codes is by using
tmux's terminal-overrides option. Like this:
set -g terminal-overrides
"*:kf20=\\033[34~,*:kf19=\\033[44~,*:kf18=\\033[54~"
Now, when I look at the terminfo man page it lists a huge number of F-keys,
up to F63 (and also including an F0 key). I think it would be awesome if
tmux could somehow support this. I don't really need 52 extra function keys
but only having 8 is not enough!
Thanks
Steven
use which are not supported by traditional terminal emulators. I tend to
use either a custom build of PuTTY on Windows or iTerm2 on OS X, which both
allow me to send arbitrary byte patterns based on keystrokes. iTerm2 is
obviously easier to configure as it has a UI for this, for PuTTY I actually
just hardcode them in.
Anyways, the only viable way that I've found so far to get these keys to
work as custom tmux binds are to load them in as unused keys that tmux is
designed to recognize. According to the manpage:
tmux allows a command to be bound to most keys, with or without a prefix
key. When specifying keys, most represent themselves (for example `A' to
`Z'). Ctrl keys may be prefixed with `C-' or `^', and Alt (meta) with
`M-'. In addition, the following special key names are accepted: Up, Down,
Left, Right, BSpace, BTab, DC (Delete), End, Enter, Escape, F1 to F20,
Home, IC (Insert), NPage/PageDown/PgDn, PPage/PageUp/PgUp, Space, and Tab.
Basically the only keys in this set that remain unused on a modern keyboard
are the F13 thru F20 keys.
So far I have consumed 3 of these mappings (for various powerful caps lock
key based shenanigans), but I am looking to add 4 more mappings (for being
triggered by Alt+Shift+H/J/K/L -- as far as I can tell, key combinations
like this as well as others like Ctrl+number keys, just aren't supported).
At this point F14-F20 are used up and this leaves me with precious little
left.
The way that I let tmux recognize my custom terminal codes is by using
tmux's terminal-overrides option. Like this:
set -g terminal-overrides
"*:kf20=\\033[34~,*:kf19=\\033[44~,*:kf18=\\033[54~"
Now, when I look at the terminfo man page it lists a huge number of F-keys,
up to F63 (and also including an F0 key). I think it would be awesome if
tmux could somehow support this. I don't really need 52 extra function keys
but only having 8 is not enough!
Thanks
Steven