code.twelvefourseven.net

tmux

Published on: 2026-02-24

Note: I use C-a as my prefix instead of C-b

See more here

Sessions

  1. Start a new session
tmux
tmux new
tmux new -s <session_name>
  1. Re-attach to existing session from command line
tmux a # reattach to last session
tmux a -t <session_name>
  1. Rename session
tmux rename -t <old_name> <new>name>
  1. Rename session inside session
C-a $
  1. Detach from session
C-a d
  1. Kill session
tmux kill-ses -t <session_name>
  1. Next / previous session
C-a n
C-a p

Windows

  1. Create new window inside session
C-a c
  1. Rename window inside session
C-a ,
  1. Close current window
C-a &
  1. Preview windows
C-a w
  1. Last/next window
C-a l
C-a n