Tmux
Open-source project
Tmux is a terminal multiplexer for Unix-like operating systems that lets a single terminal window host multiple independent terminal sessions, organized into windows and panes, which can be detached and reattached later, including across…
Definition
Tmux is a terminal multiplexer for Unix-like operating systems that lets a single terminal window host multiple independent terminal sessions, organized into windows and panes, which can be detached and reattached later, including across SSH connections. It runs as a program inside any terminal emulator rather than being a terminal emulator itself. Configuration is handled through a plain text file, and a plugin ecosystem extends its session management and status bar functionality.
Overview
tmux is a terminal multiplexer for Unix-like systems addressing the problem that a process running in a foreground terminal session dies the moment that session's connection drops, which is a serious limitation when working on a remote server over an unreliable network. It runs as a program inside any terminal emulator rather than being a terminal emulator itself. Its core capability is session persistence: a user starts a tmux session, runs long-lived processes inside it, detaches while leaving those processes running, and reattaches later from the same or a different terminal, even after the original SSH connection has fully dropped, because the processes belong to the session on the remote machine rather than to the connection itself. Within a session, windows organize work similarly to tabs, and each window can be further split into panes showing multiple terminal views simultaneously, all controlled through keyboard commands triggered by a configurable prefix key. tmux differs from iTerm2's split panes specifically in where persistence lives: tmux's session exists independently of any particular terminal emulator or connection, so it behaves identically over SSH, in a local terminal, or nested inside another multiplexer, while iTerm2's panes are a feature of one specific macOS application tied to that window. This makes tmux the more consistent choice for anyone who moves between different machines or operating systems. Administrators and developers use tmux to keep long-running remote processes alive across SSH disconnects, organize multiple terminal views into panes and windows, maintain consistent workflows across different machines, automate repeated multi-pane environment setups through scripts, and, less commonly, share a single live session between multiple users for pair programming or teaching. Configuration lives in a plain text file, typically `.tmux.conf`, and a plugin ecosystem extends functionality such as persisting sessions across reboots, but tmux must be installed and running on the machine where the session actually lives, not just on the local machine connecting to it, which is a common point of confusion for newcomers expecting persistence to come from the client side. Copy mode lets a user scroll back through a pane's history and select text using keyboard shortcuts modeled on either vi or emacs key bindings, depending on configuration. Session names can be set explicitly, which matters when multiple tmux sessions are running simultaneously on the same machine and a user needs to reattach to a specific one. Because tmux predates many modern terminal emulator features, some of its capabilities, such as pane splitting, now overlap with features built directly into newer terminal applications. Nesting tmux inside tmux over an SSH connection is possible but requires distinct prefix key bindings to avoid keystrokes being captured by the wrong session.
Key Features
- Detachable sessions that persist after disconnecting
- Windows and panes for organizing multiple terminal views
- Keyboard-driven navigation via a configurable prefix key
- Plain text configuration file for customizing behavior
- Consistent behavior across any terminal emulator or OS
- Plugin ecosystem for extended session and status bar features
- Scriptable session and pane creation for automated workflows