Core Concepts
Understanding tmux's hierarchical organization: Sessions → Windows → Panes
📋 Sessions
Persistent workspaces that survive disconnects
A Session is a collection of windows. It's the highest level of organization in tmux. You can detach from a session (leaving it running in the background) and reattach later. This is tmux's superpower.
# Create named session
tmux new-session -s myproject
# Attach to session
tmux attach -t myproject
# List all sessions
tmux ls
# Smart attach-or-create
tmux new -A -s dev🪟 Windows
Tabs within a session for organizing tasks
Windows are like tabs in a browser. Each window can contain multiple panes and has its own command history.
Ctrl+b c # Create window
Ctrl+b n # Next window
Ctrl+b p # Previous window
Ctrl+b 0-9 # Switch to window number
Ctrl+b , # Rename window
Ctrl+b & # Kill window📐 Panes
Split regions within a window
Panes split windows into multiple terminals. Essential for monitoring logs while editing code.
Ctrl+b % # Split horizontally
Ctrl+b " # Split vertically
Ctrl+b ←↑→↓ # Navigate panes
Ctrl+b z # Zoom pane (toggle fullscreen)
Ctrl+b x # Kill pane🔥 Workflow Example: Create a session for your project, use windows for frontend/backend/testing, and split panes within each window to show code editor + logs + terminal. Everything persists when you disconnect!