Skip to main content
This page answers frequently asked questions about tmux usage, configuration, and troubleshooting.

General Questions

tmux is a terminal multiplexer that allows you to:
  • Create multiple terminal sessions from a single window
  • Detach from sessions and reattach later (useful for remote work)
  • Split your terminal into multiple panes
  • Share sessions between users
  • Persist terminal sessions across SSH disconnections
It’s especially valuable for system administrators, developers working on remote servers, and anyone who needs to manage multiple terminal tasks simultaneously.
tmux has three hierarchical levels:
  • Session: The top-level container. You can attach to and detach from sessions. A session contains one or more windows.
  • Window: Similar to tabs in a web browser. Each window has a name and fills the entire terminal. A window contains one or more panes.
  • Pane: A split section of a window that runs a single terminal instance. Panes divide a window into multiple sections.
Hierarchy: SessionWindowPane
The most common pronunciations are “tee-mux” or “tmux” (rhymes with “ducks”). Both are acceptable.

Getting Started

Simply run:
To create a named session:
There are several ways:
  • Detach (keeps session running): Press C-b d or run tmux detach
  • Kill session (destroys session): Press C-b : then type kill-session
  • Exit shell: Type exit or press C-d in each pane until all panes are closed
Detaching is recommended as it preserves your session for later reattachment.
To list all sessions:
To attach to the most recent session:
To attach to a specific session:

Key Bindings

The prefix key (default C-b, Control-b) is pressed before most tmux commands. To change it, add this to ~/.tmux.conf:
Many users prefer C-a as it’s easier to type and matches GNU Screen’s default.
  • Vertical split (side by side): C-b %
  • Horizontal split (top and bottom): C-b "
Many users rebind these to more intuitive keys:
  • Arrow keys: C-b Up/Down/Left/Right
  • Select pane by number: C-b q then press the number
  • Cycle through panes: C-b o
  • Last active pane: C-b ;
You can also enable mouse support:
  • Hold C-b then press and hold an arrow key, or
  • C-b C-Up/Down/Left/Right (repeatable)
  • C-b M-Up/Down/Left/Right (resize by 5 cells, repeatable)
Or create custom bindings:

Configuration

tmux looks for configuration in these locations (in order):
  1. ~/.config/tmux/tmux.conf
  2. ~/.tmux.conf
You can also specify a config file with:
After editing your config file:
You can add a binding to make this easier:
Add these lines to your ~/.tmux.conf:
Also ensure your outer terminal supports true color.
Add to your config:
This allows:
  • Clicking to select panes
  • Dragging pane borders to resize
  • Clicking windows in status bar
  • Scrolling with mouse wheel

Copy Mode and Clipboard

  1. Enter copy mode: C-b [
  2. Navigate to start of text
  3. Begin selection: Space (vi mode) or C-Space (emacs mode)
  4. Navigate to end of text
  5. Copy: Enter (vi mode) or M-w (emacs mode)
  6. Paste: C-b ]
With mouse enabled, you can also:
  • Click and drag to select
  • Double-click to select word
  • Triple-click to select line
Add to your config:
This enables vi-style navigation (h/j/k/l, w/b, etc.) in copy mode.
On Linux with xclip:
On macOS:
Or use the built-in OSC 52 support:
If mouse mode is on but scrolling enters copy mode instead of scrolling the application:
  • Some applications need to enable alternate screen buffer
  • Try holding Shift while scrolling to scroll the terminal history
  • In alternate screen mode, scrolling is sent to the application

Session Management

  • List sessions: C-b s (choose from list)
  • Switch to last session: C-b L
  • Switch to next session: C-b )
  • Switch to previous session: C-b (
Or from command line:
  • Rename session: C-b $
  • Rename window: C-b ,
Or use commands:
By default, tmux automatically renames windows based on the running command. To disable:
Both users can attach to the same session:
For read-only access:

Troubleshooting

Common causes:
  1. Wrong TERM value: Set in your config:
  2. Missing terminfo: On some systems, install tmux-256color terminfo
  3. Outer terminal doesn’t support colors: Check your terminal emulator settings
  4. No true color support: Add terminal-overrides as shown in the configuration section
tmux waits for escape-time to determine if Escape is part of a function key sequence. Reduce the timeout:
The default is already 10ms in recent versions, but older versions used 500ms.
tmux creates login shells by default. To create non-login shells:
Or explicitly source your rc file in your shell’s profile.
Start tmux with verbose logging:
The log is written to ~/tmux-client-*.log and ~/tmux-server-*.log.
When you attach to a session, tmux preserves the environment from when the session was created. To update specific variables:
Or manually update in a running session:
Yes, but it can be confusing. The inner tmux won’t start if the $TMUX variable is set unless you use:
Consider using different prefix keys for nested sessions:

Advanced Usage

Create a script to set up your development environment:
The status bar is highly customizable:
Common workflow:
To automatically start/attach tmux on login, add to .bashrc or .zshrc:
Enable synchronize-panes:
Or bind to a key:
When enabled, input is sent to all panes in the current window. The active pane border turns red by default.

Performance

Yes, but large history uses more memory. The default is 2000 lines. To increase:
Note that this only affects new panes. Very large values (50000+) may impact performance.
Yes! tmux is excellent for slow or unstable connections because:
  • Sessions persist through disconnections
  • Only screen updates are sent (efficient protocol)
  • You can reduce status bar updates to save bandwidth:
For more detailed information, consult the tmux manual page or visit the official tmux GitHub repository.