tmux Command Cheat Sheet
tmux Sessions tmux Windows tmux Panes tmux Copy Mode
Split the current pane
tmux Start a new session. CTRL+b then c Create a new window. CTRL+b then % CTRL+b then [ Enter copy mode.
vertically.
CTRL+b then , CTRL+b then " Split the current pane q
tmux new -s [session_name] Create a new session with a specific name. Rename the current window. Exit copy mode.
horisontally.
tmux attach Re-attach to the latest active session. CTRL+b then w List all windows. CTRL+b then x Close the current pane. ENTER Copy the selected text.
Disconnect from a session, but Start text selection in
tmux detach CTRL+b then & Kill the current window. CTRL+b then o Toggle between panes. SPACE
keep it running. copy mode.
tmux attach -t [session_name] Toggle pane zoom Clear the selected text
Attach to session with a specific name. CTRL+b then n Switch to the next window. CTRL+b then z ESC
or tmux -a -t [session_name] (make pane full screen). and exit copy mode.
CTRL+b then p Switch to the previous window. Toggle between the last
tmux switch -t [session_name] Switch to a different session. CTRL+b then ; h Move the cursor left.
two active panes.
tmux list-sessions or Move the current pane
List all active sessions. CTRL+b then l Open the last window. CTRL+b then { j Move the cursor down.
tmux ls left.
tmux rename-session -t Switch to a specific numbered Move the current pane
Rename an existing session. CTRL+b then 0...9 CTRL+b then } k Move the cursor up.
[old_name] [new_name] window. right.
Terminate all sessions but Detach from the current CTRL+b then Toggle through
tmux kill-session -a CTRL+b then d l Move the cursor right.
the current one. session. SPACE different pane layouts.
tmux kill-session -t tmux select-window -t Select a specific window by Convert the current Move the cursor
Terminate a specific session. CTRL+b then ! w
[session_name] [window_name] its index or name. pane into a window. one word forward.
tmux kill-session -a -t Terminate all sessions except the tmux rename-window “ exit or Close the selected Move the cursor
Rename the current window. b
[session_name] specified one. [new_name] CTRL+b pane. one word backward.
Terminate the server, ending all sessions,
tmux kill-server Paste the
windows, and panes. CTRL+b then q Display pane number. CTRL+b then ]
copied text.
tmux Configuration
tmux Command Mode Enter tmux Command
tmux.conf CTRL+b then :
Mode.
CTRL+u Scroll up half a page.
set-option -g prefix C-a Changes the default CTRL+b
unbind C-b Move the boundary line for CTRL+b+ Scroll down half
binding to CTRL+a to activate resize-pane -D Increase pane height. CTRL+d
bind C-a send-prefix the pane downward. [up_arrow] a page.
functions.
unbind % Remaps the horizontal split to resize-pane -U Move the boundary line for CTRL+b+
Decrease pane height. PgUp Scroll up full page.
bind h split-window -h Ctrl+b+h. the pane upward. [down_arrow]
unbind '"' Remaps the vertical split key to Move the boundary line for CTRL+b+
resize-pane -R Increase pane width. PgDn Scroll down full page.
bind v split-window -v Ctrl+b+v. the pane right. [left_arrow]
set -g status-bg blue Changes the color of the status bar resize-pane -U 10 Move the boundary line up CTRL+b+
(background to blue and foreground to black).
Decrease pane width.
set -g status-fg black 10 cells. [right_arrow]
Move the boundary line of
setw -g monitor-activity on Enables visual notifications for activity
resize-pane -t 2 --R 5 cell number 2 five cells to
setw -g visual-activity on in windows.
the right.
Starts window numbering at 1 Maximize the pane to full
set -g base-index 1 resize-pane -Z screen. Use the same command to
instead of 0.
set it back to normal.
Starts pane numbering at 1
set -g pane-base-index 1
instead of 0.