Just how do I bind the tmux prefix to a Super?

I locate also Ctrl+b to be really emacs like yet I recognize the factor. I'm asking yourself if I could bind it to a solitary keypress of a key I do not various other sensible usage? particularly Super_L (additionally called the left windows key. for why I claim Super_L start xev in an incurable and also press that key)

2019-05-04 14:35:30
Source Share
Answers: 3

I have actually not had the ability to set a prefix to a personalized modifier key, yet I did take care of to specify tmux bindings in mix with a personalized modifier key under Gnome in mix with Metacity. As an example, to map Mod4+k and also Mod4+j to relocate to existing panel backwards and forwards specifically:

gconftool-2 --set /apps/metacity/keybinding_commands/command_1 --type string "tmux select-pane -D"
gconftool-2 --set /apps/metacity/keybinding_commands/command_2 --type string "tmux select-pane -U"
gconftool-2 --set /apps/metacity/global_keybindings/run_command_1 --type string "<Mod4>j"
gconftool-2 --set /apps/metacity/global_keybindings/run_command_2 --type string "<Mod4>k"

This permits tmux bindings in mix with as an example the Windows key. Something along those lines benefits any kind of window supervisor that permits to specify international key-board faster ways (Compiz, KWin, etc).

2019-06-01 07:05:17

You can not. Binding a key will certainly call the cmd_bind_key_parse function from cmd-bind-key.c which subsequently will certainly (at some point) call key_string_get_modifiers from key-string.c :

/* Find modifiers. */
105     int
106     key_string_get_modifiers(const char **string)
107     {
108         int modifiers;
110         modifiers = 0;
111         while (((*string)[0] != '\0') && (*string)[1] == '-') {
112             switch ((*string)[0]) {
113                 case 'C':
114                 case 'c':
115                 modifiers |= KEYC_CTRL;
116                 break;
117                 case 'M':
118                 case 'm':
119                 modifiers |= KEYC_ESCAPE;
120                 break;
121                 case 'S':
122                 case 's':
123                 modifiers |= KEYC_SHIFT;
124                 break;
125             }
126             *string += 2;
127         }
128         return (modifiers);
129     } 

The tmux.c has the modifier key #define affirmations and also from that documents we have :

106     /* Key modifier bits. */
107     #define KEYC_ESCAPE 0x2000
108     #define KEYC_CTRL 0x4000
109     #define KEYC_SHIFT 0x8000
110     #define KEYC_PREFIX 0x10000 

Externally however, it does not look also tough to change ; possibly a weekend break (renowned last words ;)) task?

2019-05-08 03:05:33

Super_L is an X keysym. Tmux runs in an incurable. It depends on your incurable emulator to change a keysym right into a personality series. So you would certainly need to set up both your incurable emulator and also tmux.

Considering the tmux documentation, the prefix can just been a well-known key name with an optional modifier. So you can set the tmux prefix to a key mix you do not make use of, claim M-F12, and also get your incurable to send the personality series for M-F12 when you push Super_L. With a little bit even more job, you can make use of a key that your key-board possibly does not have (tmux approves F13 via F20 as key names, yet they need to be proclaimed in terminfo ).

On the incurable emulator side, you would certainly need to schedule Super_L to create the key series \e\e[24~ (for M-F12 ) or \e[34~ (for F20 ) (where \e is the retreat personality ). Just how to do this relies on the incurable emulator (and also some aren't configurable adequate to do it ). With xterm, it's done via X resources :

! Make Super_L act as Meta+F12
XTerm.VT100.translations:       #override \
    <Key>Super_L:  string("\033\033[24~")

You might strike a grab that Super_L is generally a modifier, and also modifier keys do not constantly function when a non-modifier is called for. If you do not desire Super_L to be a modifier, you can take its modifier away, or (much less confusingly ) make use of a various keysym for the physical key. This can be done via xmodmap (antique and also straightforward to recognize ), via xkb (the modern-day, poorly-documented, effective and also intricate means ), or probably via your desktop computer setting's GUI arrangement device.

2019-05-07 23:59:21