29

I'm using Byobu (with Tmux, inside of gnome-terminal) and I have a problem with its keybindings (which I probably fail to understand).

I launch byobu, open a few windows then, from one of these windows, I ssh into another machine and launch byobu there. No matter if I press Ctrl-c or Ctrl-a-c, I'm not sure how to create and switch between windows in this remote session.

Note: if I enter Shift-F12 I can switch between windows using the Function keys in the remote session but this is less than ideal as I also need to switch between windows in the main session.

Any ideas?

Thanks in advance for your help.

1
  • 1
    Having two tmux instances is really confusing: consider avoiding it if you can. That said, I did answere your question. Mar 24 '13 at 11:44
24

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
4
  • 2
    One additional idea: if you do this often, change the command key for the inner machine to something else, like maybe ^B.
    – poolie
    Mar 24 '13 at 14:39
  • 7
    doesn't work for me. Double ctrl-a switch to another tab of the local byobu session
    – Gelin Luo
    Mar 14 '15 at 23:04
  • 1
    @green I'm experiencing the same issue, pressing two times Ctrl-a changes the tab in the outer session.
    – logoff
    Jun 30 '15 at 12:07
  • 9
    it should be Ctrl-a a c (second 'a' without control)
    – artm
    Oct 26 '16 at 9:05
24

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.

Also useful is that Shift-F12 is listed in the keybindings list of byobu's internal help which is accessible by Shift-F1 or the F1 menu's "Help - Quick Start Guide".

2
  • 2
    This is also useful for being able to send F-keys to an application running inside byobu. As also noted in: askubuntu.com/questions/146585/…
    – mp3foley
    Aug 5 '15 at 22:01
  • Is there another way to toggle keybindings? I'm on a mac, and the OS is catching Shift-F12 (I can disable that in the OS, but if there's another way it'd be handy :)
    – drevicko
    Jul 5 '20 at 0:34
2

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.

1
  • Thanks for this! I was able to set my local byobu prefix to C-b and my remote byobu prefix to C-a by altering ~/.byobu/keybindings.tmux. Trying to set this in ~/.byobu/.tmux.conf didn't work for some reason. May 27 '19 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.