Skip to content

Instantly share code, notes, and snippets.

@martin2844
Created July 7, 2025 08:23
Show Gist options
  • Save martin2844/3b59fa73b9d9ead8906c22d6c493a49c to your computer and use it in GitHub Desktop.
Save martin2844/3b59fa73b9d9ead8906c22d6c493a49c to your computer and use it in GitHub Desktop.
TMUX Shortcuts

Sessions

Command Description
tmux, tmux new, tmux new-session, new Start a new session.
tmux new -s mysession, new -s mysession Start a new session named mysession.
tmux new-session -A -s mysession Attach to mysession if it exists, otherwise create it.
tmux attach, tmux attach-session, attach Attach to the last session.
tmux attach -t mysession, tmux attach-session -t mysession Attach to session mysession.
tmux ls, tmux list-sessions List all sessions.
tmux kill-session -t mysession Kill session mysession.
tmux kill-server Kill all sessions and the tmux server.
<Prefix> + s List sessions.
<Prefix> + $ Rename current session.
<Prefix> + d Detach from the current session.
<Prefix> + ( Switch to previous session.
<Prefix> + ) Switch to next session.

Windows

Command Description
<Prefix> + c Create a new window.
<Prefix> + , Rename the current window.
<Prefix> + & Close the current window.
<Prefix> + w List windows.
<Prefix> + p Go to previous window.
<Prefix> + n Go to next window.
<Prefix> + [0-9] Select window by number.
<Prefix> + l Toggle last active window.
<Prefix> + f Find window by name.
swap-window -s 2 -t 1 Swap window 2 with window 1.
move-window -s src:win -t dst:win Move window from source to destination.
rename-window new_name Rename the current window to new_name.

Panes

Command Description
<Prefix> + " Split the current pane horizontally.
<Prefix> + % Split the current pane vertically.
<Prefix> + x Close the current pane.
<Prefix> + <Arrow Keys> Navigate between panes.
<Prefix> + o Switch to the next pane.
<Prefix> + { Move the current pane left.
<Prefix> + } Move the current pane right.
<Prefix> + z Toggle zoom for the current pane.
<Prefix> + q Display pane numbers.
<Prefix> + space Toggle between pane layouts.
<Prefix> + ! Convert the current pane into a window.
split-window -h Split the current pane horizontally via command mode.
split-window -v Split the current pane vertically via command mode.
resize-pane -L, -R, -U, -D Resize pane left, right, up, down.
select-pane -t :.+ Select the next pane.
select-pane -t :.− Select the previous pane.

Copy Mode

Command Description
<Prefix> + [ Enter copy mode.
<Prefix> + ] Paste the most recent buffer.
<Prefix> + Ctrl + u Scroll up half page in copy mode.
<Prefix> + Ctrl + d Scroll down half page in copy mode.
In Copy Mode:
Space Start selection.
Enter Copy selection.
q Exit copy mode.
/ Search forward.
? Search backward.
n Repeat last search forward.
N Repeat last search backward.
Ctrl + u Scroll up half page.
Ctrl + d Scroll down half page.
g Go to top line.
G Go to bottom line.

Miscellaneous

Command Description
<Prefix> + : Enter command mode.
set -g OPTION Set OPTION globally for all sessions.
setw -g OPTION Set OPTION for all windows.
set -g mouse on Enable mouse support.
set -g status on/off Show or hide the status bar.
set -g prefix C-a Change the prefix key to Ctrl + a.
refresh-client Refresh the terminal.
<Prefix> + r Reload the tmux configuration.

Help

Command Description
tmux list-keys, list-keys List key bindings (shortcuts).
<Prefix> + ? List key bindings inside tmux.
tmux info Show every session, window, pane, etc.
tmux man Show the tmux man page.

Note: In the above shortcuts, <Prefix> is the default prefix Ctrl + b, unless you have changed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment