A Developer In The mountains having fun

tmux - cheat sheet

Sessions

start a new Session

  • tmux
  • tmux new
  • :new
  • tmux new -s mysessionname

list Sessions

  • tmux ls
  • Ctl+b s

attach to an already running Session

last session:

  • tmux a

named session:

  • tmux a -t mysessionname

rename a session

  • ctl+b $

detach a session

  • ctl+b d

kill / del a session

  • ctl+b : to bring up the command line for tmux then type kill-session to kill the current session.

  • tmux kill-session -a deletes all sessions except current

  • tmux kill-session -t mysessionToDel

list all sessions (and optionally switch)

  • ctl-b s

While inside list of sessions

  • x - will kill (with confirmation the currently highlighted session)

move a session

  • ctl+b ( move to the next session

  • ctl+b ) move to the previous session

  • ctl+b w preview sessions & windows (allowing you to then select one to move to)

list all attached clients

  • ctl+b D which ever one you select will then be removed

Windows

create window

  • ctl+b c

rename current window

  • ctl+b ,

close current window

  • ctl+b &

moving between windows

next

  • ctl+b n

previous

  • ctl+b p

by number

  • ctl+b 0-9

Panes

toggle between panes

ctl+b ;

split pane vertically

ctl+b %

split pane horizontally

ctl+b "

show pane numbers (temp)

ctl+b q

switch to pane by number

ctl+b 0-9

close pane

ctl+b x close current pane

move to pane in direction

ctl+b arrowKey

toggle pane zoon (show only the current pane)

ctl+b z

convert pane to window

ctl+b !

toggle between pane layouts (horizontal vs vertical)

ctl+b spacebar

Copy Mode

:set -g mode-keys vi set use of vi keys in buffer

ctl+b [ Enter copy mode

ctl+b ] paste text

  • use arrow keys to navigate

  • ctl+space start selection

  • ctl+w | alt+w copy selection to tmux buffer

  • <prefix>+= — show tmux buffer contents

ctl+b PgUp Enter copy mode and scrool up one page

q exit copy mode

Enter copy the current selection

Esc clear selection

## Plugins * 'tmux-plugins/tpm' * 'christoomey/vim-tmux-navigator' * 'dracula/tmux' * 'tmux-plugins/tmux-resurrect'
more resources: https://github.com/rothgar/awesome-tmux
More places to find me
follow me on Mastodon