Terminal multiplexer
Shashank Sharma is enthralled by screen multiplexers, and Byobu presents an elegant and efficient approach to managing multiple windows.
Terminal multiplexers such as Tmux and Screen are part of the daily routine for most commandline warriors. These amazing tools can be used to run multiple shell sessions within a single terminal, or display more than one application in a single window. But these tasks are beyond the capabilities of regular terminal emulators, and you must use multiplexers.
Although multiplexers such as Screen have been around since the late 1980s, they aren’t exactly welcoming to new users or CLI novices. Byobu aims to bridge the gap by providing a wrapper over multiplexers such as Screen and Tmux, as well as add some features to appeal to even new users.
Released under the GPLv3 Licence, Byobu started its journey as a wrapper for Screen, and was only available for Ubuntu. It has since adopted Tmux as the default underlying multiplexer and can be found in the software repositories of most popular distributions such as Debian, Fedora, Arch and Gentoo.
If you’re running Debian or Ubuntu, or a derivative distribution, you can install Byobu with the sudo apt install byobu command. The sudi dnf install byobu command can similarly be used to install the project on RPM-based distributions. While it’s possible to build it from source, the project itself recommends using your distro’s package manager to install it.
Byobu is a Japanese word that refers to a folding, decorative, multi-panel screen typically used as room dividers. It’s not a multiplexer itself, but an enhancement of the rather vanilla Screen and Tmux multiplexers. It aims to provide a simplified and more welcoming user interface to these robust utilities. Byobu also stands out from these tools because of its status bar, located at the bottom, which is used to display useful system information.
You can run Byobu by invoking the byobu command, without any command options. While Byobu defaults to Tmux as the underlying multiplexer, you can run the byobu-screen command instead if you prefer Screen. The latter command only works if you already have Screen installed. If not, make sure to install it using the package manager on your distro or Byobu will exit with an error.
If you’ve never used a multiplexer such as Tmux or Screen, you should know that these tools enable you to easily split the terminal into different panes. Each of the different panes acts as an independent
terminal. This makes it possible for you to perform myriad tasks from a single interface.
After starting Byobu, you’ll be dropped to the shell prompt, with the status bar at the bottom of the screen showing a wealth of information. The status bar shows, from left to right, the name and version of your distribution, uptime, CPU and memory info, total disk space and current date and time.
Before anything else, press the F9 key to launch Byobu’s Configuration menu. It has four entries. Your first step should be to look through the Quick Start Guide from this Configuration menu. This lists all the keybindings that you can use with Byobu, such as pressing Ctrl-F2 to split the screen vertically or Shift+arrow keys to navigate between the different split panes. The easy availability of the Quick Start guide is a useful addition by Byobu to multiplexers.
You can also use the Configuration Menu to change the information displayed in the status bar, by selecting Toggle Status Notifications and pressing Enter. You can then select the info you wish to be displayed in the status bar. In addition to the information displayed by default, you can also make visible the IP address, battery status and more.
You’ll figure out the different keybindings with time, but here are some of the most useful ones to help you get started:
Although it’s fairly easy to navigate between the different windows and split panes using the keybindings, you can also enable mouse support within Byobu. Once done, you can left-click to select the different panes and also drag-and-drop to increase or decrease the size of any pane.
You can exit a Byobu session, but still maintain the layout of the different panes/windows. This is especially useful because it saves time having to relaunch all the different panes and windows that you require. To exit Byobu, but leave the session running in the background such that you can return to it anytime you want, press F6. This detaches the Byobu session, but keeps it quietly active in the background while you tackle more pressing tasks.
Advanced usage
There’s still more that you can do with Byobu, especially if you spend a lot of time on the terminal. If your Byobu screens and panes produce a lot of output, you can search through it all using Byobu’s scrollback mode.
Press F7 to enter the scrollback mode. You can now search backwards through the selected pane/window by typing ? . You’ll notice that at the bottom of the screen, just above the status bar, a new (search up) bar appears. Type the text you wish to look up, and hit Enter. Byobu will automatically highlight all matches.
The scrollback mode defaults to searching downwards, but you can also confirm this by pressing / after entering scrollback mode. The bar at the bottom now reads (search down).
Once you have a split layout that you enjoy working with, you can save it for future use by pressing Ctrl-Shift-F8. You’ll be prompted to provide a name for the layout. You can save different layouts, for different tasks, each with differently sized split panes. You can display a list of all saved layouts by running the byobu-layout list command. You can then restore a saved layout by running the byobulayout restore ≤name≥ command.
“Although multiplexers such as Screen have been around since the late 1980s, they aren’t exactly welcoming to new users or CLI novices. Byobu aims to bridge the gap by providing a wrapper over multiplexers such as Screen and Tmux, as well as add some features to appeal to even new users.”