Byobu is a powerful text-based window manager and terminal multiplexer which is wrapper around either screen
or tmux
that simplifies session management
to select the backend:
1 |
byobu-select-backend |
or
1 |
cat ~/.byobu/backend |
Start Byobu
To start Byobu, simply run:
1 |
byobu |
This will start a new session using either screen
or tmux
as the backend (you can configure which one to use).
Detach from the Byobu session
To detach from the Byobu session (leaving it running in the background), press:
1 |
F6 |
This will detach the session and return you to your local shell.
Reattach to Byobu
To reattach to your Byobu session later, simply run:
1 |
byobu |
If you have multiple sessions, you can list them with:
1 |
byobu list-sessions |
And reattach to a specific session with:
1 |
byobu attach -t session_name |
Keybindings in Byobu
Byobu uses intuitive keybindings for common tasks. Here are some of the most useful ones:
– F6: Detach from the session.
– F2: Create a new window.
– F3/F4: Navigate between windows.
Persisting Sessions Across Client Shutdowns
To ensure your session persists even if your local machine shuts down, you need to run Byobu **on the remote server**, not on your local machine. Here’s how:
1. SSH into the remote server:
1 |
ssh user@remote_server |
2. Start Byobu on the remote server:
1 |
byobu |
3. Do your work inside the Byobu session.
4. Detach from Byobu using F6
.
5. Disconnect from the remote server:
1 |
exit |
6. Later, reconnect to the remote server and reattach to your Byobu session:
1 2 |
ssh user@remote_server byobu |