tmux
Terminal multiplexer for session management, window splitting, and detach/attach.
Official WebsiteFeatures
Installation
brew install tmuxapt install tmuxpacman -S tmuxdnf install tmuxWhy Use tmux?
tmux (terminal multiplexer) is a tool that allows you to manage multiple sessions within a single terminal window and split screens for efficient work. It maintains sessions even when SSH connections drop, making it essential for remote server work.
Session Persistence
Keep working sessions alive even when SSH connections drop. Reconnect and continue working seamlessly. Essential for server management.
Flexible Screen Splitting
Split screens freely in any direction to create panes. Monitor editors, logs, and command execution all on one screen.
Multiple Window Management
Switch between multiple windows like tabs. Organize and manage by project or task type.
Advanced Customization
Freely customize keybindings, status bar, and colors. Extend functionality with plugins.
Basic Usage
About the Prefix Key
All tmux operations start with the prefix key. The default is Ctrl + b. When prefix is mentioned below, press Ctrl + b first, then the next key.
Example: prefix + c = Press Ctrl + b, then press c
Starting and Exiting tmux
# Start tmux
tmux
# Start with a session name
tmux new -s mysession
# Exit tmux (close all windows)
exit
# Or use prefix + d to detach (keep the session alive)Essential Key Bindings
Here are the most commonly used tmux key bindings. For a complete reference, see the full cheat sheet.
| Action | Key |
|---|---|
| Detach from session | prefix + d |
| Create new window | prefix + c |
| Next / previous window | prefix + n / p |
| Vertical split (side by side) | prefix + % |
| Horizontal split (stacked) | prefix + " |
| Navigate between panes | prefix + arrow |
| Zoom / restore pane | prefix + z |
| Enter copy mode | prefix + [ |
In-Depth Guides
Dive deeper into specific tmux topics with our comprehensive guides.
Cheat Sheet
All key bindings and commands in one quick-reference page. Perfect for bookmarking and printing.
5 min readSplit Window & Panes
Master horizontal and vertical splits, pane navigation, resizing, layouts, zoom, and synchronized input.
10 min readSession Management
Create, attach, detach, and organize sessions. Includes scripting for automated session setup.
8 min readConfiguration (.tmux.conf)
Customize prefix key, status bar, colors, mouse, vi mode, performance settings, and more.
12 min readCopy Mode & Clipboard
Copy text, search output, and integrate with system clipboard on macOS and Linux.
8 min readPlugins (TPM)
Set up TPM and essential plugins: resurrect, continuum, yank, vim-navigator, and more.
10 min readTips
- •Using
tmux new -A -s mainis convenient: it attaches if the session exists, or creates a new one if it doesn't. - •Many people change the prefix key to
Ctrl+a(same as screen). See the configuration guide. - •Press
prefix + zto temporarily maximize a pane. Press again to restore. - •Using tmux Plugin Manager (tpm) simplifies plugin management. See the plugins guide to get started.
- •Press
prefix + ?to view the current keybindings. Useful for checking after configuration changes.
Related Articles
GNU Screen - Terminal Multiplexer
Classic terminal multiplexer with session persistence
Zellij - Modern Terminal Multiplexer
Modern Rust-based terminal multiplexer with intuitive UI
Byobu - tmux/screen Wrapper
Enhanced wrapper for tmux and screen with convenient keybindings
tmux Cheat Sheet: All Key Bindings & Commands
Complete tmux cheat sheet with all keyboard shortcuts, commands, and quick reference tables for sessions, windows, panes, and copy mode.
tmux Split Window & Pane Management Guide
Master tmux split windows and pane management. Learn horizontal and vertical splits, pane navigation, resizing, layouts, zoom, synchronized input, and practical workflows.
tmux Session Management: Complete Guide
Complete guide to tmux session management. Learn how to create, attach, detach, list, and organize sessions for efficient terminal workflows.
tmux.conf Configuration Guide: Customize Your tmux
Complete tmux.conf configuration guide. Learn prefix key customization, key bindings, status bar styling, mouse settings, true color, performance tuning, and workflow-specific configs.
tmux Copy Mode: Copy, Paste & Clipboard Guide
Master tmux copy mode for copying text, searching, and clipboard integration. Covers vi and emacs modes, system clipboard setup for macOS and Linux, and buffer management.
tmux Plugins Guide: TPM, Resurrect, Continuum & More
Complete guide to tmux plugins. Learn TPM (Tmux Plugin Manager) setup, essential plugins like resurrect, continuum, sensible, yank, and vim-navigator with best practices.