What Is a Terminal Multiplexer and What Does It Do?

Updated

A terminal multiplexer is a program that runs inside your terminal and lets one terminal window or SSH connection host multiple sessions, windows, and panes — and keep them alive after you disconnect. You need one when you work over SSH, want to split one terminal into several views, or need a long-running process to survive a dropped connection. You probably don't need one for quick single-window local work. Zellij is a modern example: it is free and open source, and its maintainers also run a paid hosted session-sharing service that is currently in beta.

The problem a multiplexer solves

A normal terminal window is one view onto one shell. Close the window or lose the network, and whatever was running in that shell is gone. A multiplexer sits between your terminal and your shells and adds three things:

  • Multiple views from one connection. Split the screen into panes, or keep several windows/tabs, all inside a single terminal or SSH session.
  • Persistence. The multiplexer keeps running in the background. Detach, close the laptop, reconnect later, and reattach to the same session with the same state.
  • Sharing. Because sessions are managed by the multiplexer rather than the terminal window, they can be attached to from more than one place.

Multiplexer vs. terminal emulator vs. shell

These are three different layers, and knowing which one you're choosing prevents confusion:

Layer Examples Job
Terminal emulator iTerm2, Windows Terminal, GNOME Terminal Draws text, handles fonts, colors, and keyboard input in a window
Shell bash, zsh, fish, Xonsh Interprets your commands and runs programs
Multiplexer Zellij, tmux, screen Manages multiple sessions/panes and keeps them alive across disconnects

A multiplexer runs inside a terminal emulator and around your shells. So "split panes" can mean two things: the emulator's own split feature (which dies with the window) or the multiplexer's panes (which persist). If persistence is the point, you want the multiplexer's panes.

What you actually do with one

  • Split panes: run an editor in one pane, logs or a test watcher in another, a shell prompt in a third — all in one window.
  • Detach and reattach: start a long build or a remote job, detach, log out, come back later, and reattach to find it still running.
  • Survive disconnects: work on a remote machine over SSH; if the connection drops, the session on the server keeps going.
  • Share a session: hand someone a view of your session for pairing or support. Zellij's maintainers offer this as a paid hosted service (in beta); self-hosted sharing is a general multiplexer capability.

Zellij as a concrete example

Zellij describes itself as a "terminal workspace with batteries included," written in Rust. On its site you can download builds for Linux, macOS, and Windows, or try it without installing — for bash/zsh:

bash <(curl -L https://zellij.dev/launch)

For fish:

bash (curl -L https://zellij.dev/launch | psub)

For PowerShell:

irm https://zellij.dev/launch.ps1 | iex

The site links to the scripts that will be executed, so you can read them before running. The "batteries included" framing points at the usual multiplexer features — panes, sessions, detach/reattach — presented with defaults and on-screen hints rather than requiring a large config file first. Note that the try-without-installing commands download and execute a script; if that's not acceptable in your environment, use a normal install instead.

When a multiplexer is unnecessary

Skip it if all of the following are true: you work locally, in one window, and nothing you run needs to outlive that window. A terminal emulator's built-in tabs and splits cover that case with less to learn. Add a multiplexer when you start needing sessions that persist, remote work over SSH, or a consistent pane layout you can reattach to — that's the point where the extra layer pays for itself.