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.

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
add comment

1 Answer

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
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.