tmux.md

tmux #

A terminal multiplexer: run many shells in one terminal, split into panes, and keep sessions alive after you disconnect. Almost everything starts with the prefix Ctrl-b, then a key. Below, Ctrl-b c means press Ctrl-b, release, then c.

Sessions (from the shell) #

tmux                         # start a new session
tmux new -s work             # new named session
tmux ls                      # list sessions
tmux attach -t work          # attach to a session ( a = attach )
tmux kill-session -t work    # kill one session
tmux kill-server             # kill everything

Sessions (inside tmux) #

KeyAction
Ctrl-b dDetach (session keeps running)
Ctrl-b sList / switch sessions
Ctrl-b $Rename the session
Ctrl-b ( )Previous / next session

Windows (like tabs) #

KeyAction
Ctrl-b cCreate a window
Ctrl-b ,Rename the window
Ctrl-b n pNext / previous window
Ctrl-b 09Jump to window by number
Ctrl-b wList windows
Ctrl-b &Kill the window

Panes (splits) #

KeyAction
Ctrl-b %Split vertical (left/right)
Ctrl-b "Split horizontal (top/bottom)
Ctrl-b ←↑↓→Move between panes
Ctrl-b oCycle to the next pane
Ctrl-b zZoom the pane (toggle fullscreen)
Ctrl-b { }Swap pane left / right
Ctrl-b xKill the pane
Ctrl-b spaceCycle pane layouts

Copy mode #

KeyAction
Ctrl-b [Enter copy mode (scroll back)
SpaceStart selection (then move)
EnterCopy the selection
Ctrl-b ]Paste
qQuit copy mode
/ ?Search forward / backward

Configuration #

# ~/.tmux.conf
set -g mouse on                  # mouse to select panes, scroll, resize
set -g base-index 1              # number windows from 1
setw -g mode-keys vi             # vi keys in copy mode
bind r source-file ~/.tmux.conf  # Ctrl-b r reloads the config

# remap the prefix to Ctrl-a (screen style)
unbind C-b
set -g prefix C-a
bind C-a send-prefix
tmux source-file ~/.tmux.conf    # reload without restarting

© 2026 anguishedturtle.com · Bit Night Runner · Support · Privacy