I'd like to use ctrl-\ as the command key for tmux.

Ctrl-a and ctrl-b conflict with bash and emacs bindings.

set-option -g prefix C-\

When I start a tmux session, I get:

/Users/justin/.tmux.conf: 40: bad key: C-   

This works perfectly on ubuntu, but not Mac OS Mountain Lion

If this binding won't work on the Mac, any recommendations for the best command binding?


1 Answer 1


You are probably running tmux 1.7 on your Mac, but something earlier on your other boxes (the problem is version specific, not platform specific).

In tmux 1.7 a backslash at the end of the line is treated as a line continuation (so that you can break up long commands onto multiple lines, as in most shells).

You can use quotes to protect the backslash in a way that is compatible with both versions (the syntax is different depending on whether you prefer single or double quotes):

set-option -g prefix 'C-\'
set-option -g prefix "C-\\"
  • Thanks -- In the meantime I switched to the common C-a binding and switched bash to vi mode so I don't want to hit ctrl-a all the time. So not sure if I'll go back to ctrl-\. Dec 20, 2012 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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