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

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

In short you can add the following line into your tmux.conf to control "tmux inside tmux". This line define your bind key to CTRL+A for the "remote" session.

bind-key -n C-a send-prefix

The shortcut C-a can be change by any other free keys.

Then you can use CTRL+Bto control you tmux session level1 (default) and CTRL+Ato control the second tmux session.

share|improve this answer

You must log in to answer this question.

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