Multiplexers#
A terminal multiplexer lets one terminal window run many shell sessions in parallel: split panes, named windows, and, crucially, sessions that survive disconnect. The classic remote-work pattern: SSH to a server, attach a multiplexer, work for hours; if the network drops, reconnect and pick up exactly where you left off.
Not strictly shells, but adjacent enough to belong here.
tmux#
tmux, the modern de-facto choice. Available on every distribution, scriptable end-to-end, and the assumed multiplexer in most documentation written after 2010. The mental model below is the language the rest of this page uses.
Mental model:
Server, one daemon per user, manages everything.
Session, a workspace; persists across disconnect.
Window, like a browser tab inside a session.
Pane, a split inside a window, running its own shell.
Daily commands:
$ tmux new -s work
$ tmux ls
$ tmux attach -t work
$ tmux kill-session -t work
The prefix key (default Ctrl-b) starts every command:
Keys |
Action |
|---|---|
prefix c |
new window |
prefix & |
kill window (with confirm) |
prefix n / p |
next / previous window |
prefix 0..9 |
switch to window N |
prefix , |
rename window |
prefix % |
split vertically (left / right) |
prefix “ |
split horizontally (top / bottom) |
prefix arrow |
move between panes |
prefix z |
zoom / un-zoom current pane |
prefix x |
kill current pane |
prefix d |
detach (session keeps running) |
prefix [ |
enter copy/scroll mode |
prefix ] |
paste |
prefix : |
command prompt ( |
Common ~/.tmux.conf tweaks:
# Easier prefix
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Mouse mode
set -g mouse on
# Vim-style pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Renumber windows when one closes
set -g renumber-windows on
# 256 / true color
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
Plugin manager: tpm, with
tmux-resurrect and tmux-continuum for persistence across reboots.
GNU screen#
screen, the original multiplexer, predating tmux by decades. Pre-installed on essentially every Unix host that has not been actively trimmed down, which makes it the fallback for any environment where tmux is missing and you cannot install it.
Available almost everywhere by default.
Smaller feature set than tmux; uglier defaults.
Default prefix
Ctrl-a.
When tmux isn’t installed and you can’t install it (older servers, appliances), screen is usually there.
Zellij#
Zellij, modern, written in Rust, with discoverable defaults. The on-screen status bar lists keybindings in real time so first-time users can be productive without a cheat sheet, a deliberate “Fish to tmux’s Bash” positioning.
On-screen status bar lists keybindings, so you can use it without memorizing.
Configurable via KDL.
Floating panes, plugins (in WASM), built-in session manager.
Sane defaults out of the box.
Zellij is the “Fish to tmux’s Bash”, friendlier defaults at the cost of ubiquity. Excellent for new users; a real alternative for everyone.
abduco / dvtm / dtach#
Minimalist alternatives for operators who want detach-and-reattach without the rest of the tmux feature set. Useful when running a long script remotely that you might want to disconnect from but do not need panes or windows around:
abduco, session attach/detach only; pair with
dvtmfor window/pane management.dtach, the simplest possible attach/detach wrapper around any program.
Useful when you only want detach, not the rest of the tmux feature set – e.g. running a long script remotely.
Shell-Native Persistence#
For some workflows, alternatives to multiplexing exist at the
transport layer. mosh is the main one, a UDP-based SSH
replacement that survives network changes and intermittent
connectivity natively, and pairs well with tmux underneath for
session persistence:
mosh, mobile shell; SSH replacement that survives network changes and intermittent connections natively. Pair with tmux for persistence and pane management.
screen/tmuxovermoshis a common combination.
When to Use a Multiplexer#
A multiplexer earns its keep any time a session needs to outlive the terminal, remote work, long-running builds, multi-pane workflows that would otherwise need many windows. Even on a local machine, running everything inside one is cheap insurance against accidental terminal closes:
Long-running remote sessions that shouldn’t die on disconnect.
Multi-pane workflows, editor + log tail + REPL + tests.
Reproducible workspaces, a project’s tmux layout in a script (
tmuxp,tmux-popup).
Even on local machines, many engineers run everything in tmux just for the persistence after a graphics-driver hiccup or accidental terminal close.
Modern Terminal Emulators with Built-In Multiplexing#
Some terminal emulators provide native splits and tabs without a multiplexer at all, the emulator manages the panes itself, with GPU-accelerated rendering and no shell-level overhead. Useful for local-machine pane management; for remote persistence across SSH you still need tmux, Zellij, or mosh underneath:
These cover local-machine pane management. For remote persistence across SSH, you still need tmux (or zellij, or mosh).
Pick One and Learn It#
Multiplexer skill compounds. The keybindings become muscle memory; the session model becomes part of how you think about work. Pick tmux for ubiquity, Zellij for friendliness, or screen when nothing else is available, and stop bikeshedding which one’s best.