I'm currently on OS X using iTerm2 and byobu, and I can't figure out how to split my screen vertically on OS X. On Linux, I can split my screen vertically with Ctrl+F2, but on OSX, that doesn't work, thanks to Apple's different keyboard.
I Googled all around for the solution, and I can't figure this out. I can split my screen horizontally with Shift+F2, but I need to be able to split vertically. Has anyone figured out how to get byobu's keyboard bindings to work well with Apple computers?
Thanks in advance.
Looks like there's on open bug on this issue.
I was able to configure iTerm2 to use byobu locally on OS X as well as remotely over ssh on an Ubuntu 14.04 server.
Using:
First, in your OS X system preferences, edit your keyboard settings and remove or change any shortcut settings that may conflict with byobu (i.e. Ctrl + F1-F12).
Here's a workaround that will work without adding full functionality to the FN keys. This will allow you to split windows vertically using the byobu escape key:
Start byobu
.
Set your desired Ctrl-A behavior by running: byobu-ctrl-a
. I chose to go with Emacs-mode.
Run byobu-config
and choose or change your escape sequence. I went with the new default Ctrl + S. The F12 key is also an escape sequence
Now you can issue a command with your escape sequence. Try F12 then % or Ctrl + s then % to split a window vertically. For a full list of commands, try Ctrl + s then ? or F12 then ?.
You can add some key mappings to your iTerm2 profile to get the CTRL, ALT, SHIFT, and FN keys to work with byobu. This is tedious, but I went through the exercise and it seems to work. I don't think there's an automated way to save these key mappings with iTerm2.
Open the Keys pane and manually add the following key bindings. Here's an example how to add one key binding:
CTRL + F2
[1;5Q
You can determine the control characters for any key sequence not listed here by referring to the tmux source code.
Repeat this for all of these mappings to make the corresponding byobu command work:
[1;5Q
[1;6Q
[1;3D
[1;3C
[1;3A
[1;3B
[1;5R
[1;5S
[1;6R
[1;6S
[1;4D
[1;4C
[1;4A
[1;4B
[15;5~
[15;6~
[17;3~
[17;5~
[5;3~
[6;3~
[19;5~
[19;4~
[19;6~
[20;5~
[23;3~
[23;5~
[24;3~
[24;5~
[2;3~
To get things to work we needed to:
Some other references on escape sequences: SO link and xterm-keys.c
It looks like there are some difference in tmux window default directory between tmux 1.8 and tmux 1.9 (Src, Src, Src). If you are using byobu with tmux 1.9 you can try adding this to your ~/.byobu/keybindings.tmux
file so that when you create new windows or vertical/horizontal splits that they open in the same directory as the current pane:
unbind-key -n F2
bind-key -n F2 display-panes \; new-window -c "#{pane_current_path}" -n -
unbind-key -n C-F2
bind-key -n C-F2 display-panes \; split-window -hc "#{pane_current_path}"
unbind-key -n S-F2
bind-key -n S-F2 display-panes \; split-window -vc "#{pane_current_path}"
unbind-key %
bind-key % display-panes \; split-window -hc "#{pane_current_path}"
unbind-key |
bind-key | display-panes \; split-window -vc "#{pane_current_path}"
Press F5 to reload settings.