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 just started using tmux and trying to get a few bindings to work the same as on screen. One of the binding that I used very often on screen was to start copy mode and selection at the same time, as it is very useful when in vi (position the cursor where you want using vi commands, and start selecting with one command). I tried the below, but it doesn't work:

bind Space copy-mode ; send-keys Space

It starts the copy mode, but send-keys command seems to be ignored. I also tried sending the "[ Space" as a key sequence, but that didn't even switch the mode, though I can see they get sent literally. Is there a different way that this can be achieved?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You need to escape the semicolon so that it is part of the binding (multiple commands in the binding) instead of separating multiple commands in your configuration file (send-keys executed right after bind-key when your server is first starting up).

bind Space copy-mode \; send-keys Space

If you happen to make this binding from the command line you need to escape it once for tmux and once again for the shell:

tmux bind Space copy-mode \\\; send-keys Space

# OR

tmux bind Space copy-mode '\;' send-keys Space
share|improve this answer
    
Thank you, and bonus points for explaining why it is needed. –  haridsv Jan 23 '13 at 8:56
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.