tmux
tmux = unammed session
tmux new -s <name>
tmux ls
tmux attach -t <name>
tmux a = attach to last used session
tmux kill-session -t <name>
tmux kill-server
inside tmux
prefix = Ctrl + b
prefix+d = detach from session ( keep running in bg)
prefix+$ = rename session
prefix+s = list all session interactive mode
tabs:
prefix+c — Create a new window
prefix+, — Rename the current window
prefix+n — Switch to next window
prefix+p — Switch to previous window
prefix+0-9 — Jump directly to window number N
prefix+w — Interactive visual list of windows/panes
prefix+& — Close current window (prompts for confirmation)
splits:
prefix+% — Split current pane vertically (left / right)
prefix+" — Split current pane horizontally (top / bottom)
prefix+Arrow Key — Move focus between panes
prefix+o — Cycle focus to the next pane
prefix+; — Toggle back to the last active pane
prefix+z — Toggle pane zoom (maximize current pane full screen / restore)
prefix+{ or } — Swap position of current pane with adjacent pane
prefix+x — Close current pane (prompts for confirmation)
copy,navigate
Press Ctrl + b then [ to enter copy mode.
Navigate using Arrow Keys, PageUp/PageDown, or Vim keys (h, j, k, l).
Press Space to start selecting text, Enter to copy the selected text to tmux buffer, and q to exit copy mode.
Press Ctrl + b then ] to paste the copied buffer.
cat ~/.tmux.conf
# Enable mouse mode (scrolling, clicking panes/tabs)
set -g mouse on
# Increase scrollback history limit
set -g history-limit 10000
# Start window/pane indexing at 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1