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'm using tmux to manage my windows, etc, and one of the things I do is SSH to a remote server and connect to a tmux session running there. Once there, however, I cannot sent C-b through to that tmux session (the one running in ssh in my original, local tmux).

Is there a way around this?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Press Ctrl-b once for the local tmux and again for the remote one, then the key for the command you want to use on the remote session.

share|improve this answer
    
Too easy, thanks :) –  Isaac Hodes Jan 30 '11 at 22:05
    
Alternatively, change the prefix key for the tmux you've SSH'd into, and you don't have to hit anything twice. –  Rob Dec 14 '11 at 17:35
add comment

If you haven't mapped Ctrl+b Ctrl+b

If you haven't mapped Ctrl+b Ctrl+b to last-window to emulate screen's behavior (which is quite popular), then you can use that as your prefix for the inner tmux session. So to issue commands to the inner session you would use Ctrl+b Ctrl+b Command

The above answer assumes your prefix key is still Ctrl+b on both machines.

If you have mapped Ctrl+b Ctrl+b

If you have mapped Ctrl+b Ctrl+b, then you'll need to use tmux's :send-prefix command. Many people map this to Ctrl+b b to emulate screen's default behavior. You would add this to your .tmux.conf to add this binding permanently:
bind b send-prefix

Then you can issue commands to the inner session using Ctrl+b b Command
(or without the binding using Ctrl+b :send-prefix Command)

The above answer assumes your prefix key is still Ctrl+b on the outer session.

share|improve this answer
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.