How to quickly send commands to nested tmux sessions?
It is one less keypress to send a command to your nested session if you choose a different key. I use Ctrlt for my standard prefix, and Ctrla for nested sessions.
# set prefix key to ctrl+t
unbind C-b
set -g prefix C-t
# send the prefix to client inside window
bind-key -n C-a send-prefix
Note that I use the -n
switch. From the bind-key entry in man tmux
:
if -n is specified, it is not necessary to use the prefix key, command is bound to key alone.
So, as an example, Ctrlt, c opens a new window in tmux; Ctrla, c does the same in the nested session.