Skip to content
Shamik edited this page Mar 19, 2026 · 1 revision

TMUX session

  1. tmux new -A -s [session name]
  2. tmux new-session -s [session name]

Attaching an existing TMUX session

  1. tmux attach-session -t [session name]
  2. tmux attach -t [session name]

Listing all TMUX sessions

  1. tmux ls

Killing a tmux session

  1. tmux kill-session -t [session name]
  2. If you are already inside a TMUX session, then exit or tmux detach

Killing TMUX server, will destroy all TMUX sessions

  1. tmux kill-server

Use TMUX on a remote host over ssh

ssh -i access_keys/dynamic-hero.key -t ubuntu@129.80.133.167 ‘tmux -CC new -A -s dynamic’

Switching between multiple tmux windows

Ctrl+b n - next window

Ctrl+b p - previous window

Ctrl+b [window number] - select window number

New window

Ctrl+b c

Kill window

Ctrl+b &

Scroll

Ctrl+b [ {page up / down}

Start selecting text

spacebar

Detach from tmux session without closing it

Ctrl+b d

If you have nested tmux session running then to detach only from the inner tmux Ctrl+b Ctrl+b d

iTerm

Starting a new TMUX session

There are two ways to start TMUX sessions on ITERM2. One way is to start a basic TMUX session and the other way is to launch it in control mode . The allows ITERM2 to manage all the TMUX windows and panes. This will always launch a new TMUX window separate from the terminal window.

Integration Best practices

Control Mode; works only for iterm

  1. tmux -CC new -A -s [session name]
  2. tmux -CC new-session -s [session name]

Clone this wiki locally