tmux vs screen: what is the difference

Both keep programs running on a server after you disconnect, and for that job either one works. tmux has a status bar and easy panes by default, and every action is a named command you can script. GNU screen is the older tool, and it can also connect to serial ports. If neither is a habit yet, tmux is the simpler start. On a server that has only screen, use screen.

Updated . tmux 3.5a and screen 4.09.01 on Debian 13 in a throwaway container: sessions started in the background, listed, sent keys and closed. The screen 4.00.03 that ships with macOS 27 was checked too.

Side by side

Tasktmuxscreen
Prefix keyCtrl+bCtrl+a
New named sessiontmux new -s workscreen -S work
DetachCtrl+b dCtrl+a d
List sessionstmux lsscreen -ls
Attachtmux attach -t workscreen -r work
Start in the backgroundtmux new -d -s workscreen -dmS work
New windowCtrl+b cCtrl+a c
Split top and bottomCtrl+b "Ctrl+a S
Split side by sideCtrl+b %Ctrl+a |
Next region or paneCtrl+b oCtrl+a Tab
Send keys from a scripttmux send-keys -t work 'ls' Enterscreen -S work -X stuff 'ls\n'
Status bar by defaultYesNo
Serial portsNoYes, for example screen /dev/ttyUSB0 115200
LicenseISC and BSD styleGPL

Differences that matter in practice

Panes

A tmux pane is a shell from the moment you split. A new screen region is empty, and you have to move to it and press Ctrl+a c.

The prefix key

In a shell, Ctrl+a normally jumps to the start of the line. Under screen you press Ctrl+a a for that. tmux uses Ctrl+b, which is less often used.

Scripting

Both can be driven from outside, as the table shows. tmux has more to work with, such as tmux capture-pane -p to read the screen and tmux has-session to test for a session.

Availability

Neither is sure to be on a minimal server, but you can install either from standard package repositories on Debian and Ubuntu:

sudo apt install tmux
sudo apt install screen

Debian 13 packages tmux 3.5a and screen 4.9.1. macOS still ships screen 4.00.03 from 2006, and no tmux. For the current tmux on a Mac, use Homebrew: brew install tmux.

When a session cannot be attached

A session that is still attached somewhere else will not open with a plain screen -r, which prints There is no screen to be resumed matching work. Use screen -d -r work to detach it from the other place first. In tmux, tmux attach -d -t work does the same thing.

For the full list of tmux commands, see the tmux cheat sheet.

Why a session survives a dropped connection is explained in keep SSH sessions alive with tmux.

Questions

Is tmux better than screen?

For keeping programs running after you disconnect, both work. tmux is easier to start with, thanks to its status bar, ready panes and scriptable commands. screen is the one to use for serial ports or when it is the only tool on the server.

Which one is installed by default?

Neither is sure to be on a minimal server. On Debian and Ubuntu, install either with sudo apt install tmux or sudo apt install screen.

Can a tmux session be attached from two places at once?

Yes. tmux attach -t work joins a session that is already attached elsewhere, and tmux attach -d -t work detaches the other place first.

Sources

More in Sessions and tmux

All guides