Frequently Asked Question
tmux Cheat Sheet
Last Updated about an hour ago
tmux Cheat Sheet
tmux Cheat Sheet
Quick Reference for Ctrl+B Commands
Ctrl+Bthen?– Show help menu of available key bindings.Ctrl+Bthenc– Create a new window.Ctrl+Bthenn– Move to the next window.Ctrl+Bthenp– Move to the previous window.Ctrl+Bthen"– List all windows in the current session.Ctrl+Bthen%– Split the current pane vertically.Ctrl+Bthen"– Split the current pane horizontally.Ctrl+Bthenx– Kill the current pane.Ctrl+Bthend– Detach the session (leave it running in the background).Ctrl+Bthen:– Enter tmux command prompt.Ctrl+Bthen[– Enter copy mode (use arrow keys orvim‑style keys to scroll).Ctrl+Bthen]– Paste the most recent copy.Ctrl+Bthen:followed byset -g mouse on– Enable mouse support for resizing and selecting panes.
Common Operations & Features
tmux new -s mysession
- Start a new session
tmux ls
- List all sessions
tmux attach -t mysession
- Attach to a running session
- Rename the current window
- Inside tmux:
Ctrl+Bthen,(type new name and press Enter). - Or from shell:
tmux rename-window newname.
- Kill a window or pane
- Window:
Ctrl+Bthen&(confirm kill). - Pane:
Ctrl+Bthenx.
- Resize panes (when mouse is enabled or using arrow keys)
Ctrl+BthenAlt+Arrow(orCtrl+B:resize-pane -L 5etc.).
- Synchronize panes (send same input to all panes)
Ctrl+Bthen:set-window-option synchronize-panes on- To disable: replace
onwithoff.
- Switch between sessions quickly
Ctrl+Bthens– choose from a list of sessions.
- Detach other clients (keep your session alive while disconnecting others)
Ctrl+BthenD.
tmux source-file ~/.tmux.conf
- Reload configuration file
Tips for Efficient Use
set -g mouse on
bind-key -n C-a send-prefix
- Create a
.tmux.confin your home directory to customise key bindings and enable mouse support: - Use session names that describe the work context (e.g.,
dev,prod,lab) for quick identification. - Split panes to run multiple commands side‑by‑side without leaving tmux.
- Leverage copy mode (
Ctrl+B [) to search within output usingCtrl+For/pattern. - Persist work across terminal disconnects by using
tmux detachand laterattach.
What to Check Next
- If a command isn’t working, verify that you’re inside a tmux session (
echo $TERMshould showscreenortmux). - Ensure your
.tmux.confisn’t overriding any of the default key bindings you rely on. - Check for any custom aliases or scripts that might interfere with tmux key sequences.
