How to pass command keys to a remote tmux session when you SSH from a local tmux session into a remove tmux session

linux, ssh, tmux

Solution

You can set up

bind-key b send-prefix

in your `.tmux.conf`. By default all commands go to the outermost tmux session. If you press `<prefix-key>`b (`<prefix-key>`=ctrlb by default) the commands go to the inner session. Here an example:

ctrl-b   c  # create new window in the outer session
ctrl-b b c  # create new window in the inner session
ctrl-b   %  # create split window in the outer session
ctrl-b b %  # create split window in the inner session

Problem

I would like to use my ssh tmux session inside my development tmux session, but it makes tmux behave bad (keys go to wrong session, etc). Is there a way to do it properly?

Original source

Related problems