How to use Byobu keybindings in a nested remote session?
I'm assuming that you configured byobu to use Ctrl-A as tmux's escape sequence.
The commands that you type in your terminal are first handled by your local tmux instance, then handled by the nested tmux session. This means you need to escape twice to go to the nested instance:
- Ctrl-a c # opens a window in your local session
- Ctrl-a Ctrl-a c # opens a window in your remote session
If the second line does not work, try (as pointed out by @artm)
- Ctrl-a a c # second a without Ctrl
I found using Shift-F12 to toggle on/off the outer byobu's keybindings is a bit easier to remember and use. The only new key to remember is Shift-F12, and then the inner byobu can be controlled with the normal F- keybindings.
Found that solution here.
Ctrl-a Ctrl-a
also didn't work for me. I found that it worked after commenting the following line in .byobu/keybindings.tmux
:
unbind-key -n C-a
Another workaround would be to use the internal Tmux send-key
command:
- select the pane or window where the nested session runs
- press Ctrl+a : enter
send-key -2
and then the command or key you want to send
Examples:
- Ctrl+a :
send-key -2
c = create new window - Ctrl+a :
send-key -2
p = switch to previous window - Ctrl+a :
send-key -2
n = switch to next window
Not very intuitive, but works even with Putty.