Discussion:
Can we get Tmux to support more Function keys (F-keys) than just up to F20?
Steven Lu
2014-10-12 14:11:40 UTC
Permalink
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
Nicholas Marriott
2014-10-14 08:19:51 UTC
Permalink
tmux in git has F1-F63, although they are now treated as modifiers
because that is how you generate them in practice:

F1-F12 are F1 to F12
F13-F24 are S-F1 to S-F12
F25-F36 are C-F1 to C-F12
F37-F48 are C-S-F1 to C-S-F12
F49-F60 are M-F1 to M-F12
F61-F64 are M-S-F1 to M-S-F3
Post by Steven Lu
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
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Steven Lu
2014-11-21 04:39:40 UTC
Permalink
Is there a reference that shows what the escape key codes for those
modified function keys (F13-F64) should be? Most terminal emulator
applications don't really have good coverage of these key combinations, but
e.g. iTerm for OS X does allow you to assign arbitrary escape sequences to
key combinations.

So this means I should be able to get all 64 F-keys on iTerm as long as I
go through and assign all the bindings, without having to set
terminal-overrides.

Thanks
Steven

On Tue, Oct 14, 2014 at 4:19 AM, Nicholas Marriott <
Post by Nicholas Marriott
tmux in git has F1-F63, although they are now treated as modifiers
F1-F12 are F1 to F12
F13-F24 are S-F1 to S-F12
F25-F36 are C-F1 to C-F12
F37-F48 are C-S-F1 to C-S-F12
F49-F60 are M-F1 to M-F12
F61-F64 are M-S-F1 to M-S-F3
Post by Steven Lu
I have many traditionally unsupported key combinations that I would
like
Post by Steven Lu
to use which are not supported by traditional terminal emulators. I
tend
Post by Steven Lu
to use either a custom build of PuTTY on Windows or iTerm2 on OS X,
which
Post by Steven Lu
both allow me to send arbitrary byte patterns based on keystrokes.
iTerm2
Post by Steven Lu
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
Post by Steven Lu
work as custom tmux binds are to load them in as unused keys that
tmux is
Post by Steven Lu
designed to recognize. According to the manpage:**
tmux allows a command to be bound to most keys, with or without a
prefix
Post by Steven Lu
key.** When specifying keys, most represent themselves (for example
`A' to
Post by Steven Lu
`Z').** Ctrl keys may be prefixed with `C-' or `^', and Alt (meta)
with
Post by Steven Lu
`M-'.** In addition, the following special key names are accepted: Up,
Down, Left, Right, BSpace, BTab, DC (Delete), End, Enter, Escape, F1
to
Post by Steven Lu
F20, Home, IC (Insert), NPage/PageDown/PgDn, PPage/PageUp/PgUp,
Space, and
Post by Steven Lu
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
Post by Steven Lu
key based shenanigans), but I am looking to add 4 more mappings (for
being
Post by Steven Lu
triggered by Alt+Shift+H/J/K/L -- as far as I can tell, key
combinations
Post by Steven Lu
like this as well as others like Ctrl+number keys, just aren't
supported).
Post by Steven Lu
At this point F14-F20 are used up and this leaves me with precious
little
Post by Steven Lu
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
Post by Steven Lu
function keys but only having 8 is not enough!
Thanks
Steven
------------------------------------------------------------------------------
Post by Steven Lu
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Loading...