Skip to content

Instantly share code, notes, and snippets.

@entrofi
Last active July 19, 2025 03:44
Show Gist options
  • Select an option

  • Save entrofi/ed3bda5c00ab902ab731d9fe04a7f4dd to your computer and use it in GitHub Desktop.

Select an option

Save entrofi/ed3bda5c00ab902ab731d9fe04a7f4dd to your computer and use it in GitHub Desktop.
tmux cheatsheet

Tmux CheatSheet

Session Management

Tmux create session

tmux new -s session_name creates a new tmux session named session_name

Tmux attach session

tmux attach -t session_name attaches to an existing tmux session named session_name

Tmux switch to session

tmux switch -t session_name switches to an existing session named session_name

Tmux list sessions

tmux list-sessions lists existing tmux sessions

Tmux detach sessions

tmux detach (prefix + d) detach the currently attached session

Tmux rename sessions

tmux rename-session [-t current-name] [new-name] | prefix + $ rename session

Window Management

Tmux create a window

tmux new-window (prefix + c) create a new window

Tmux select a window

  1. tmux select-window -t :0-9 (prefix + 0-9) move to the window based on index
  2. tmux select-window -t [index]: (prefix + ') move to the window by prompted index.
  3. tmux choose-window : (prefix + w) show all windows and choose one by browsing through the list

Tmux rename a window

tmux rename-window (prefix + ,) rename the current window

Tmux list windows

tmux list-windows Lists all windows

Tmux kill window

tmux kill-window (prefix + &) Kill current window

Panes

Tmux create vertical pane

tmux split-window (prefix + ") splits the window into two vertical panes

Tmux create horizontal pane

tmux split-window -h (prefix + %) splits the window into two horizontal panes

Tmux swap panes

tmux swap-pane -[UDLR] (prefix + { or }) swaps pane with another in the specified direction

Tmux kill panes

tmux kill-pane (prefix + x) Kills the active pane

Tmux select pane

  1. tmux select-pane -[UDLR] selects the next pane in the specified direction
  2. tmux select-pane -t :.+ selects the next pane in numerical order

Resizing Panes

Resize pane down

prefix + :resize-pane -D <new_size>

Resize pane up

prefix + :resize-pane -U <new_size>

Resize pane left

prefix + :resize-pane -L <new_size>

Resize pane right

prefix + :resize-pane -R <new_size>

Scroll mode

To turn on scroll mode in a pane

prefix + [

then you can use standard navigation keys

To turn off scroll mode in a pane press q

Resurrect plugin

set -g @plugin 'tmux-plugins/tmux-resurrect'

prefix C + s Save session prefix C+r Restore session

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