Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 1 down vote accepted

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .