tmux
A terminal multiplexer that enables running multiple terminal sessions within a single window, with persistent sessions that survive disconnections.
Also known as: Terminal Multiplexer
Category: Software Development
Tags: software-engineering, tools, productivity
Explanation
tmux (Terminal Multiplexer) is a terminal application that allows running multiple terminal sessions within a single window. It enables splitting the terminal into panes, creating multiple windows, and most importantly, detaching sessions that continue running in the background. This makes tmux essential for remote work, long-running processes, and organizing complex terminal workflows.
The key concepts in tmux are sessions, windows, and panes. A session is a collection of windows managed by tmux. A window is a single screen within a session, similar to browser tabs. A pane is a subdivision of a window, allowing split views. All tmux commands are triggered using a prefix key (default: Ctrl+b) followed by a command key.
tmux offers several compelling benefits. Persistent sessions allow you to detach and reattach without losing work. Remote resilience means SSH disconnections won't kill your processes. Workspace organization is achieved through multiple projects in separate sessions. Split views let you see multiple terminals simultaneously. Session sharing enables pair programming with collaborators.
Common session management commands include 'tmux new -s name' to create a named session, 'tmux ls' to list sessions, 'tmux attach -t name' to attach to a session, and 'tmux kill-session -t name' to terminate one. Inside tmux, prefix+d detaches from the session, prefix+c creates a new window, prefix+% splits a pane vertically, and prefix+" splits horizontally.
tmux is configured via ~/.tmux.conf, where you can customize the prefix key, enable mouse support, change the base index for windows, and set up custom keybindings. The plugin ecosystem, managed through TPM (Tmux Plugin Manager), extends functionality with tools like tmux-resurrect for saving and restoring sessions, tmux-continuum for automatic session saving, and tmux-yank for system clipboard integration.
Related Concepts
← Back to all concepts