- Sessions: groups of windows
- Windows: tabs inside a session
- Panes: splits inside a window
- Starting and Attaching Sessions
tmux
# Starts a new unnamed session.
tmux new -s mysession
- Creates a session named
mysession.
tmux attach -t mysession
- Attaches to an existing session.
tmux ls
- Detaching from a Session
Ctrl-b d
- Press
Ctrl-b, release, then press d.
- The session keeps running in the background.
- Working with Sessions
tmux rename-session -t <oldname> <newname>
tmux kill-session -t <mysession>
- Rename or destroy sessions from outside tmux.
- Windows: Tabs Inside a Session (A window is like a browser tab inside your tmux session)
Ctrl-b c
Ctrl-b w
- List all windows and choose one.
Ctrl-b n # next window
Ctrl-b p # previous window
Ctrl-b , # rename the current window
- Useful Window Commands
tmux new-window -n editor
tmux kill-window -t 2
tmux select-window -t 1
- Can be used from outside or inside tmux.
- Panes: Splits Inside a Window
- Panes allow you to split a single window into multiple terminals.
Ctrl-b %
Ctrl-b "
Ctrl-b x
Ctrl-b o
Ctrl-b ;
- Toggle between current and previous pane.
- Resizing Panes
Ctrl-b Ctrl-arrow keys
- Resize pane in direction of arrow key.
Ctrl-b : resize-pane -L 10
Ctrl-b : resize-pane -R 10
- Resize pane from the command prompt inside tmux.
- Synchronize Panes
Ctrl-b :
set-window-option synchronize-panes on
- Typing in one pane mirrors input to all panes in the window.
- Useful for managing distributed servers or parallel CLI tasks.
- Moving Panes and Converting Between Panes and Windows
Ctrl-b !
- Convert the current pane into its own window.
Ctrl-b :
join-pane -s 2 -t 1
- Move a pane from window 2 into window 1.
- Zooming a Pane
Ctrl-b z
- Toggles between:
- zoomed fullscreen pane
- normal layout
- Layouts (Auto-arranging Panes)
Ctrl-b space
- Cycles through layouts:
- even-horizontal
- even-vertical
- main-horizontal
- main-vertical
- tiled
- Quick Overview of Key Bindings
| Feature |
Shortcut |
Description |
| Create session |
tmux new -s name |
Start a named session |
| Detach |
Ctrl-b d |
Detach from session |
| New window |
Ctrl-b c |
Create a new window |
| Next/previous window |
Ctrl-b n / Ctrl-b p |
Navigate windows |
| Vertical split |
Ctrl-b % |
Split pane vertically |
| Horizontal split |
Ctrl-b " |
Split pane horizontally |
| Switch pane |
Ctrl-b o |
Move to next pane |
| Resize pane |
Ctrl-b Ctrl-arrow |
Resize active pane |
| Zoom |
Ctrl-b z |
Toggle fullscreen pane |
| Kill pane |
Ctrl-b x |
Close current pane |