Byobu - Multiple windows in Terminal
Byobu is a light, powerful, text-based window manager based on GNU Screen. Using Byobu, you can quickly create and move between different windows over a single SSH connection or TTY terminal, monitor dozens of important statistics about your system, detach and reattach to sessions later while your programs continue to run in the background.
Last update: 2022-05-07
Table of Content
Byobu is an easy-to-use wrapper around the
screen) terminal multiplexer. Byobu’s primary features include multiple console windows, split panes within each window, notifications and status badges to display the status of the host, and persistent sessions across multiple connections.
Byobu’s primary features include multiple console windows, split panes within each window, notifications and status badges to display the status of the host, and persistent sessions across multiple connections.
Ubuntu should come with Byobu installed by default. To check that Byobu is installed, try running this command to output its version.
If it is not installed, install it with a simple command:
sudo apt install -y byobu
Byobu can be configured to run by default at every text login (SSH or TTY). That behavior can be toggled with the
Insert below line to the end of
~/.bashrc will run Byobu whenever a local terminal is run:
_byobu_sourced=1 . /usr/bin/byobu-launch 2>/dev/null || true
When running Byobu for the first time, it will start with just in a single window. The bottom of the screen has the status bar, which displays OS and version, a list of open windows, and various system metrics like pending updates, RAM usage and time and date.
A session is simply a running instance of Byobu. A session consists of a collection of windows, which are basically shell sessions, and panes, which are windows split into multiple sections.
Ctrl-F6 or type
exit to end a session.
Byobu is a configuration layer on top of GNU Screen. As such, all of GNU Screen’s keybindings work in Byobu exactly as in Screen. Moreover, Byobu provides a comprehensive, advanced set of commands bound to the F-keys on most keyboards.
||Create a new window|
||Split the screen horizontally|
||Split the screen vertically|
||Move to the previous window|
||Move focus to the next split|
||Move to the next window|
||Move focus to the previous split|
||Exit the session|
||Detach from the session and logout|
||Detach from the session, but do not log out|
||Reconnect any SSH/GPG sockets or agents|
||Refresh all status notifications|
||Enter scroll back/search mode|
||Rename the current window|
||Launch the Byobu Configuration Menu|
||GNU Screen’s Escape Key|
||Scroll back through this window’s history|
||Scroll forward through this window’s history|
||Collapse all splits|
||Toggle all of Byobu’s keybindings on or off|
Copy & Paste, Search
Each window in Byobu has up to 10000 lines of scroll back history, so a user can enter and navigate using the
Alt-PageDown keys. Exit this scroll back mode by hitting
Copy and paste text from scroll back mode:
- Press the
Space barto start highlighting text
page downto select the text
Enterto copy the text
- Paste the text using
Search up and down in scroll back mode:
/to search down
?to search up
Actually, in scroll back mode, Byobu support
h - # Move the cursor left by one character j - # Move the cursor down by one line k - # Move the cursor up by one line l - # Move the cursor right by one character 0 - # Move to the beginning of the current line $ - # Move to the end of the current line G - # Moves to the specified line (defaults to the end of the buffer) ctrl + b - # Page up ctrl + f - # Page down / - # Search forward ? - # Search backward n - # Moves to the next match, either forward or backward
: (to enable the internal terminal), then enter the command
set mouse on
for other commands, run
Alt-F12 to toggle mouse.
Actions in the mouse mode:
- Switch between active panes and windows. Click on a window name or pane to switch.
- Scroll, with the mouse wheel or trackpad
- Resize panes by dragging and dropping
To enable mouse support by default for all these operations, add these lines to
set -g mouse on set -g mouse-select-pane on set -g mouse-select-window on set -g mouse-resize-pane on set -g mouse-utf8 on
The Backend Multiplexer#
By default, Byobu will use
tmux as the backend multiplexer. However, if a user prefers to use screen, they can easily change the enabled backend.
Select the byobu backend: 1. tmux 2. screen
Byobu uses default border characters from
tmux which shows bold borderlines.
Those borderlines are made up of rows and columns in the console, and they are indivisible. In a text-based terminal there is no structural element smaller than one character “cell” (which is about the size of that block cursor). The only way to reduce the size of the borders is to reduce the size of all rows/columns.
Fortunately, we can manipulate the colors to give the appearance of a thinner border: set the foreground to the desired color and set the background to the background color of panes. For the latter
default value is often sufficient.
For example, change the borderline to orange, add these lines to
set -g pane-active-border-style fg=colour208,bg=default