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

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?

share|improve this question
up vote 3 down vote accepted

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-\\"
share|improve this answer
    
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-\. – justingordon Dec 20 '12 at 22:05

You must log in to answer this question.

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