How can I set tmux hotkey as Ctrl-, that is, Ctrl+comma

Jianwen W. picture Jianwen W. · Mar 29, 2012 · Viewed 9.1k times · Source

I've got some trouble when setting my preferred tmux hotkey on Mac OS X.

The most common hotkeys that invokes tmux's magics are CTRL+A and CTRL+B. But I would rather select other keystrokes for the following reasons: C-a is the global hot key for "jumping to the beginning of a line"; C-b is for "moving backward on a line" and "Page UP in Vim". I don't want to break these nice rules in tmux.

So, I try to set some non-so-frequently-used keystrokes for tmux hotkey. What I choose is CTRL-, , CTRL-., or CTRL-;

I write this statement in my .tmux.conf file:

set-option -g prefix C-,

I start tmux. Oh, it says "bad key". I replace C-, with C-. or C-;. It doesn't work either.

So, how can I set tmux hotkey to CTRL-,?

Answer

chepner picture chepner · Mar 29, 2012

Had to dig into the source code for this one. The control key can only be applied to letters, @, space and ? (and C-@ seems to be equivalent to C-space). Sorry, doesn't look like C-, is possible, at least in tmux-1.6.