Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Lots of people modify their tmux prefix keys. Usually it's Control+something. But surely other things are possible.

I tried, for example, ,t, but on starting tmux, I got the error bad key: ,t.

So what are the rules? What prefixes are allowed in tmux?

share|improve this question
add comment

1 Answer 1

It needs to be a single “key stroke”.

The basic set of recognized keys includes

  • the ASCII characters (including the C0 control characters),
  • the function keys: F1F20,
  • the movement keys: Up, Down, Left, Right, Home, End, PageUp, PageDown,
  • the editing keys: IC (Insert), DC (Delete), and
  • the keypad keys: KP/, KP*, KP-, KP+, KP., KPEnter, KP0KP9.

Not all terminals support sending unique sequences for all those keys; also, not all of those keys are described in every terminfo entry (indicated by the TERM environment variable when attaching to a tmux session). So, some of them might not be available in your particular setup.

If an Escape character precedes the sequence for one of the above keys, then it will be treated as a Meta modifier. This is represented as a M- prefix when naming the key (e.g. M-F1).

tmux also recognizes some special sequences that xterm can send when Shift, Control, and Meta are used with most of the non-ASCII keys (e.g. S-C-M-Up), but many terminals do not generate these sequences (or only support a limited set of modifiers for just the arrow keys).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.