tmux vs screen: one terminal multiplexer?
In this article
Yes, you can replace tmux with screen, or screen with tmux, and run your entire terminal workflow inside a single multiplexer — but the two tools differ enough that the better choice depends on how you work. Both let you run multiple shell sessions in one terminal window, detach and reattach, and keep processes alive after you close the window, but tmux offers more modern scripting, better split panes, and a more active development history, while screen is older, preinstalled on many systems, and simpler for basic use.
What a terminal multiplexer actually does
A multiplexer sits between your terminal emulator and your shell. It creates a server process that owns one or more virtual terminals, each running its own shell or program. Your terminal window shows one of those virtual terminals, and you can switch between them with keyboard shortcuts. When you detach, the server keeps running in the background, so a long compile, download, or SSH session continues even if you close the window or lose your connection. When you reattach, you get your exact screen back.
Both tmux and screen provide the same core features:
- Multiple named sessions, each with multiple windows
- Split panes within a window (side-by-side or stacked)
- Detach and reattach from a session
- Scrollback buffer with search
- Copy and paste between panes
- Custom key bindings and configuration files
The practical effect is that you can do all your work in one terminal window, organized into tabs and splits, without needing a graphical terminal with tabs. Many remote developers use a multiplexer over SSH so that a dropped connection doesn't kill their work.
Key differences between tmux and screen
The most visible difference is the default prefix key. tmux uses Ctrl-b, screen uses Ctrl-a. That single key determines most of your muscle memory. Beyond that, the differences are architectural and feature-based.
tmux was first released in 2007 and is actively maintained. It has a client-server model where the server runs continuously and clients attach to it. This allows multiple clients to attach to the same session, and it enables scripting via tmux send-keys and tmux new-session -d. tmux also has a built-in command prompt, a status bar that you can fully customize, and a powerful pane system that supports resizing, moving, and even swapping panes between windows.
screen dates back to 1987 and is maintained by the GNU project. It is preinstalled on most Linux distributions and macOS (though macOS ships an older version). Screen's configuration is simpler, and its escape sequences are well documented. However, screen's pane support is more limited: you can split horizontally and vertically, but resizing and rearranging is clunkier. Screen also has a learning curve for its command syntax, which is different from tmux's.
How to replace one with the other
If you are already comfortable with screen and want to move to tmux, or vice versa, the migration is mostly about learning new key bindings. The core concepts map directly:
- Screen's
Ctrl-a c(new window) becomes tmux'sCtrl-b c - Screen's
Ctrl-a n/Ctrl-a p(next/previous window) become tmux'sCtrl-b n/Ctrl-b p - Screen's
Ctrl-a d(detach) becomes tmux'sCtrl-b d - Screen's
Ctrl-a S(horizontal split) becomes tmux'sCtrl-b %(vertical split) andCtrl-b "(horizontal split) — note the swapped terminology
The quickest way to switch is to start with a simple tmux config that mimics your screen habits. For example, if you are used to Ctrl-a, you can rebind the tmux prefix to Ctrl-a in ~/.tmux.conf:
set -g prefix C-a unbind C-b bind C-a send-prefix
Then reload with tmux source-file ~/.tmux.conf. Similarly, if you want to keep screen's split keys, you can bind | and - to tmux splits.
Choosing the right multiplexer for your workflow
There is no universal answer. The right choice depends on your priorities:
- Preinstalled and minimal: screen wins. It is almost always already on a server, and its basic usage is just
screenthenCtrl-a dto detach. - Modern scripting and automation: tmux wins. You can script complex layouts with
tmux new-window,tmux split-window, andtmux send-keys. This makes tmux popular among developers who automate their dev environment. - Multiple clients on one session: tmux supports this natively with
tmux attach -t sessionfrom multiple terminals. Screen can do it withscreen -x, but tmux handles it more gracefully. - Terminal compatibility: screen is slightly more conservative and works on a wider range of ancient terminals. tmux requires a terminal that supports certain escape sequences, which is a non-issue for modern terminals.
If you only need to keep a single long-running process alive and reattach occasionally, screen is perfectly adequate. If you want a programmable, scriptable environment with pane management, tmux is the stronger tool.
Common problems and how to solve them
Both tools have quirks that trip up new users. Here are the most common issues:
- Detached session but can't reattach: If you get "sessions should be nested" or "no session found", check that you are using the right server. If you are inside a tmux session and run
tmux attach, it will complain. Usetmux detachfirst, or runtmux attachfrom outside. - Scrollback not working: In tmux, you must enter copy mode with
Ctrl-b [to scroll. In screen, you useCtrl-a Esc. The mouse wheel may not work unless you enable mouse mode:set -g mouse onin tmux, ortermcapinfo xterm* ti@:te@in screen. - Colors look wrong: Set
TERMcorrectly. Usescreen-256colorfor screen andtmux-256colorfor tmux. Addset -g default-terminal "screen-256color"in tmux, orterm screen-256colorin screen. - Key bindings conflict with your shell: The prefix key may clash with readline shortcuts. You can change the prefix in the config file, as shown above.
Alternatives to tmux and screen
If neither tool feels right, there are modern alternatives that offer similar functionality with different trade-offs:
- Zellij: A newer multiplexer written in Rust, with a built-in layout system, a bottom status bar, and mouse support out of the box. It aims to be more beginner-friendly than tmux.
- dvtm: A dynamic tiling window manager for the terminal, often paired with
dtachfor detach/reattach. It is lightweight but less feature-rich. - GNU Screen with byobu: Byobu is a wrapper that adds a status bar and more intuitive key bindings to screen (or tmux). It is preinstalled on Ubuntu Server and many other distros.
- Terminal emulators with built-in tabs and splits: Modern terminals like iTerm2, Konsole, and Windows Terminal offer native tabs and split panes, which can eliminate the need for a multiplexer if you never detach or reattach.
None of these are drop-in replacements, but they show that the multiplexer space is active and evolving.
Frequently Asked Questions
Can I run tmux inside screen or screen inside tmux?
Technically yes, but it is almost always a mistake. Running one multiplexer inside another causes key binding conflicts and confusing behavior. If you accidentally do it, detach from the inner one first, then the outer. The only legitimate use is when you are already in a tmux session on a remote server and need to attach to a screen session on that same server — but even then, it is better to use the same tool.
Which one uses less memory or CPU?
Both are lightweight. screen is slightly smaller in memory footprint because it has fewer features, but the difference is negligible on modern hardware. On a very old or resource-constrained server, screen might be the safer bet, but for any normal use, the difference is not a deciding factor.
How do I keep a process running after I close my laptop?
Start the process inside a multiplexer, then detach. For tmux: tmux new -s mysession, run your command, then Ctrl-b d. For screen: screen -S mysession, run your command, then Ctrl-a d. Close the terminal. The process continues. Reattach later with tmux attach -t mysession or screen -r mysession.
Can I share a session with another user?
tmux allows multiple clients to attach to the same session, and you can set the socket permissions to allow another user to attach. Screen also supports this with screen -x for multiuser mode, but it requires more configuration. In practice, sharing a session is more common with tmux because it is simpler to set up and more reliable.
Is there a way to use tmux without learning all the key bindings?
Yes. You can enable the mouse in tmux with set -g mouse on, which lets you click panes, scroll, and resize with the mouse. You can also use a plugin manager like tpm to install a status bar and key binding presets. But even with the mouse, you will need to know at least the prefix key and a few commands to detach and create windows.
Which one should I learn first if I am a beginner?
Start with tmux. It has better documentation, a more active community, and more consistent behavior across platforms. The learning curve is similar to screen, but the payoff is higher because tmux scales better to complex workflows. If you are on a system where tmux is not installed and you cannot install it, then learn screen.