0 Aug 5, 2018

An introduction to Byobu

Byobu advertises itself as a terminal multiplexer and a terminal window manager. But what those words actually mean?

If we start from scratch, a terminal is the text-based interface to computers. On Windows computers, it’s called the Command Prompt. While it could be seen as the “old-fashioned” way to interact with computers, for programmers, system administrators and in many other technical fields, terminals (and text-based user interfaces) are still used widely due to their efficiency and speed of use.

As a layer on top of the terminal, programs such as screen and, later, tmux were created to allow users to better manage their terminals: with them, you could disconnect from a server, and still have your program running, and then connect to it later as if you were never gone. You can split the screen in several parts (that’s the multiplex part), so you can change a configuration file while streaming a log file and watching your changes take effect in real time, just like you’re dragging windows around on your Mac or PC. You can also have several desktops – or windows – that can be switched between, just like on your Mac. That’s the window manager part.

Byobu is again a layer on top of Screen and tmux. Think of it as an extension: Byobu is a collection of scripts and utilities that enhances the behaviour of these programs.

Installing byobu

On Debian, Ubuntu and similar Linux distributions: apt-get install byobu

For other distributions, see the official site.

On Mac: first get Homebrew, then brew install byobu

First run

When running byobu for the first time, it will start with just your shell in a single window. The bottom of your screen has the status bar, which displays your OS and version, a list of open windows, and various system metrics like pending updates, RAM usage and time and date.

To change these, press F9, choose Toggle Status Notifications, and select/unselect the ones you want.

Something you should do first is to choose Byobu’s escape sequence. That’s a special key that can trigger some of Byobu’s functionality. Think of it as a shortcut key. Type CTRLA, or run byobu-ctrl-a . If you’re in doubt, use “Emacs mode”, which let’s you keep using CTRLA to navigate text. Byobu’s default escape sequence is then F12, which you’ll use in a minute.

You can also make Byobu start automatically with byobu-enable. It’s useful on servers where you probably don’t have a lot of different terminal windows open, and want your terminal history and programs to be running between sessions. To disable that, use byobu-disable.

Basic window management

Creating a window: F2

Create a horizontal split pane: SHIFTF2 (or F12|)

Create a vertical split pane: CTRLSHIFTF2 (or F12%)

Go back and forward through window list: F3 and F4

Go back and forward through split panes: SHIFTF3 and SHIFTF4

More window management

Close a window, or a pane: CTRLD

Toggle between layout grid templates: SHIFTF8

Scrolling: SHIFTALTPage-down/up

Search down (while scrolling): /

Search up (while scrolling): ?

Naming a window: F8

Fullscreen a pane: F12 then Z

To visually navigate your windows, with previews: F12 then S, then arrow keys, numbers

Mouse mode

Type F12, then : (to enable the internal terminal), then set mouse on (for other commands, list-commands) then ENTER to enable mouse mode. With it you can do several actions with the mouse:

  • 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

Display the time

To display the time in big letters, press F12 then T.

Quitting

To exit byobu, leaving your session running in the background (and logging out, if you’re in a SSH session), F6. (To avoid logging out, use SHIFTF6.)

To completely kill your session, and byobu in the background, type F12 then : and type kill-server.

More information

 


Leave a Comment




Note: Your comment will be shown after it has been approved.