Skip to content
daniel@MacBookPro:~
Shell & TerminalHow-To September 21, 2026 2 min read

How to Use screen as a Session-Persistence Tool

A complete walkthrough of GNU screen — older and less feature-rich than tmux, but still genuinely useful, and often already pre-installed on systems where tmux isn't.

GNU screen predates tmux as a terminal session multiplexer, and while tmux has largely superseded it in general popularity, screen remains genuinely useful — particularly on older or more minimal systems where it’s already installed and tmux isn’t.

Step 1: check whether screen is already installed

screen --version

Screen ships pre-installed on many Unix-like systems by default, unlike tmux, which is a more common reason to reach for it specifically — no installation step needed if it’s already present.

Step 2: install screen if needed

sudo apt install screen     # Debian/Ubuntu
brew install screen         # macOS
pkg install screen          # FreeBSD

Step 3: start a new named session

screen -S work

Step 4: understand screen’s prefix key

Ctrl-a   (screen's default prefix, distinct from
          tmux's default Ctrl-b)

Screen’s default prefix key is the historical origin of the “remap tmux’s prefix to Ctrl-a” convention many tmux users adopt — for users switching between both tools, keeping them consistent avoids relearning muscle memory.

Step 5: detach from a session

Ctrl-a then d

Exactly like tmux, detaching leaves the session and everything running inside it alive in the background.

Step 6: reattach to a running session

screen -r work

If a screen session was left in an “attached” state due to an unclean disconnect (a dropped SSH connection, for instance), force reattachment with:

screen -d -r work

Step 7: list currently running sessions

screen -ls

Step 8: create multiple windows within one session

Ctrl-a then c    (create a new window)
Ctrl-a then n    (next window)
Ctrl-a then p    (previous window)

Screen supports multiple windows within a session similarly to tmux, though its default pane-splitting support (Ctrl-a then S for a horizontal split, | for vertical) is less commonly used and less refined than tmux’s equivalent.

Step 9: know screen’s genuine limitations relative to tmux

Screen’s scripting and configuration capabilities, and its pane management specifically, are generally considered less capable than tmux’s — most users choosing between the two for a new setup, without a specific reason to prefer screen, tend toward tmux; screen’s continued relevance comes primarily from its wider default pre-installation and long historical track record.

Why screen still deserves a place in your toolkit despite tmux’s popularity

Encountering a remote server or minimal environment where screen is present and tmux isn’t — and where installing new software isn’t practical or permitted — is common enough that knowing screen’s basic session-persistence commands (detach, reattach, list sessions) remains genuinely useful, even if tmux is your primary choice everywhere you have a free choice between the two.