tmux session in Solarized Dark with hand-rolled status bar

tmux — Getting Started & Cheatsheet

Prefix = C-a · hand-rolled status bar (Solarized default, theme-aware) · vim-style pane nav
view full screenshot

Getting started / what's set

At a glance

PrefixC-a (screen-style)
Why not C-Spaceconflicts with macOS input-source switching
Pane navC-a + h/j/k/l
SplitsC-a + | / - (cwd inherited)
Indexingwindows + panes start at 1, auto-renumber
Mouseon (URLs: ⇧⌘ click)
History50,000 lines
Bellssilenced (bell-action/visual-bell/monitor-bell off)
TPM pluginstpm, tmux-sensible, tmux-sessionx, tmux-fingers

Open / quit

tmuxstart a new session
tmux new -s <name>named session
tmux a / tmux a -t <name>attach to last / named session
tmux lslist sessions
C-a ddetach (session keeps running)
C-a rreload ~/.config/tmux/tmux.conf
C-a ttmux-sessionx picker popup (tmux / tmuxinator) — live pane preview for the highlighted session
s [<project>] [<name>]create-or-attach worktree+session — inside tmux 1 arg = worktree name in current project, outside tmux 1 arg = project, 0 args = fzf picker
C-a Tclock-mode (swapped from default t)
C-a Popen current branch's PR in browser via gh pr view --web (silent when no PR — counterpart to the orange status-bar PR pin)
⇧⌘ clickClaude Code file links → routes via macOS file-type defaults (OSC 8 passthrough enabled in tmux.conf via terminal-features hyperlinks)
C-a ?list all keybindings
C-a :command prompt

House rules (per CLAUDE.md)

Sessions / persistent workspaces

From inside tmux

C-a ddetach
C-a ssession picker (tree)
C-a $rename current session
C-a Tab / S-Tabnext / prev session (repeatable; defaults (/) unbound)
C-a Spaceswitch to last session (default L unbound)

Closing the last pane of a session (exit, Ctrl-D) switches to the most-recently-used other session via detach-on-destroy off. Detaches only when no other session exists.

From the shell

tmux new -s workcreate "work"
tmux a -t workattach to "work"
tmux kill-session -t workkill "work"
tmux kill-serverkill all sessions

Session picker prefix t

C-at opens tmux-sessionx, a TPM-loaded session picker. Sources: existing tmux sessions plus tmuxinator projects (@sessionx-tmuxinator-mode 'on'). Zoxide is intentionally not a picker source (@sessionx-zoxide-mode 'off'). The current session is hidden from the list (@sessionx-filter-current 'true').

Highlighting an entry shows live pane content in the preview pane (tmux capture-pane -ep on the session's active pane). The plugin claims the binding via @sessionx-bind 't' — no manual bind-key exists for this picker. Geometry is pinned at 70% × 70% (@sessionx-window-width / @sessionx-window-height), the shared anchor with the URL and file pickers.

Sesh stays installed for bin/s (the worktree+session command), which still reads sesh list -c -j as its project registry. The shared .config/sesh/sesh.toml + machine-local ~/.config/sesh/sesh.local.toml split is unchanged. _ZO_EXCLUDE_DIRS excludes (~/, ~/Downloads/*, ~/.config/*, ~/Library/*) remain for z-cd hygiene.

Windows / tabs in a session

Manage

C-a ccreate window — opens at session root (@session_root, set by s) when present, else inherits pane cwd
C-a &kill window (confirm)
C-a wwindow picker (tree)
C-a < / >swap window left / right (repeatable; -d keeps focus on the moved window — its index changes, not yours)
:rename-window <name>force a name (no keybind — automatic-rename would clobber it anyway)

Switch

C-a . / ,next / prev window (repeatable; defaults n/p and tmux-sensible's C-n/C-p unbound)
C-a 19window 1–9 by number
C-a llast window (but l is also pane-right here — see "Quirks")
C-a ffind by name (search)

Quirk: we rebind C-al to pane-right (vim style). To hop between windows, use C-a,/. or the picker.

Panes / splits inside a window

Move & close

C-a h / j / k / lleft / down / up / right
C-a ;last (most-recent) pane
C-a xkill pane (confirm)
C-a qshow pane numbers (then number to jump)
C-a zzoom toggle (full-screen pane)
C-a !break pane → its own window
C-a { / }swap pane left / right in layout

Resize / layout

C-a H / J / K / Lresize 5 cells (when bound by tmux-sensible)
C-a Spacecycle preset layouts
C-a M-1M-5specific layouts (M = Alt; avoid here)
:resize-pane -D 5resize from prompt (D/U/L/R)
:select-layout main-verticalforce a layout by name

Splits / keep cwd, mirror Ghostty

Create

C-a |vertical split (right) — keeps cwd
C-a -horizontal split (below) — keeps cwd

Defaults " and % are unbound — use |/-.

Copy mode & scrollback / vi-style

Enter / exit

C-a [enter copy mode
q / Escexit copy mode
C-a ]paste tmux buffer
C-a =choose buffer to paste

Inside copy mode

h j k lmove cursor
w / bword forward / back
0 / $line start / end
g / Gtop / bottom
/ / ?search forward / back
n / Nnext / prev match
Spacebegin selection
Entercopy selection (to tmux buffer)
v / Vchar / line selection (vi-mode)

Mouse drag also selects. macOS clipboard is wired through tmux's default OSC 52 path; if your terminal supports it (Ghostty does) Enter reaches the system clipboard.

Fingers — one-keystroke copy prefix F / J

Morantron/tmux-fingers overlays vimium-style letter hints on every visible match in the active pane. Press the hint letter; the match lands on the macOS clipboard via pbcopy. Built-in patterns cover paths, URLs, SHAs, IPs, UUIDs, k8s names, git status / diff hunks; custom patterns add worktree-… branch names and #N PR/issue refs.

C-a Fcopy-mode: hint → letter → clipboard
C-a Jjump-mode: hint → letter → cursor at match (inside copy-mode)
azpick a hint (single letter copies / jumps)
Tabmulti-select — pick several matches before confirming
letterpaste match into the current pane instead of clipboard
Ctrl letteropen match (URL → browser, path → Finder via macOS default)

Hint colors use ANSI palette refs (colour9/colour13/colour14) so they auto-adapt across themes — no theme-set handoff needed. First-run: after prefix + I, the wizard appears — pick "Build from source" (crystal required).

Status bar / hand-rolled Solarized

Layout

Bottom bar, bg=base02 / fg=base0. Three segments:

Default palette (Solarized Dark — follows theme-set)

base03 base02 base01 base0 base2 base3
blue (session) green (active win) yellow (worktree branch) violet (main branch) orange (PR pin) cyan (selection) red

These are the Solarized Dark default values. The bar sources the active palette (~/.config/themes/current.tmux@color_*), so colors follow theme-set; the accent roles (session=blue, active window=green, worktree=yellow, main=violet, PR=orange, selection=cyan) map per-theme.

Selection / message style uses cyan-on-base03; pane border switches base01 → blue when active.

Status helpers

~/.config/tmux/bin/tmux-status-rightorchestrator for the right-side status segment — composes PR pin (when present) + git chip flush-right
~/.config/tmux/bin/tmux-pr-detectstale-while-revalidate file cache around gh pr view (TTL 60s) — echoes PR number for current branch or empty
~/.config/tmux/bin/tmux-git-statusgit/worktree status segment, colors as args
~/.config/tmux/bin/tmux-ssh-indicatorwalks each attached client's ps ancestry; prints + space when any ancestor is sshd/sshd-session/mosh-server — prepended inside the session chip
~/.config/tmux/bin/tmux-claude-usageparses ccpulse status --json and emits the violet 7d + yellow 5h fused chip pair on the left of the status bar; atomic hide when ccpulse is missing or fields are null
scripts/test-helpers.shsmoke-tests for the helpers
scripts/test-tmux-pr-status.shsmoke tests for tmux-pr-detect + tmux-status-right (uses a PATH-shimmed gh)
scripts/test-tmux-claude-usage.shsmoke tests for tmux-claude-usage (PATH-shimmed ccpulse stub; covers hide cases, formatter, threshold boundaries)

Worktree detection uses git rev-parse --git-dir vs --git-common-dir so it works for .claude/worktrees/*, worktrunk paths, and sibling worktrees alike.

Useful command-prompt commands / C-a :

Common

:new-window -c "#{pane_current_path}"new window in same dir
:swap-window -t :+1move window right
:movew -rrenumber windows now
:setw synchronize-panestype to all panes (toggle)
:clear-historyclear scrollback
:source-file ~/.config/tmux/tmux.confreload (also C-ar)
:show -g | grep …inspect global options
:list-keysall bindings

Tmux from outside

tmux send-keys -t mywin "ls" Entertype into a target pane
tmux display-message -p '#S'print current session name
tmux info | grep …debug runtime state

Config notes / ~/.config/tmux/tmux.conf

# Prefix
set -g prefix C-a            # C-Space conflicts with macOS input-source switching

# Terminal — truecolor
set -as terminal-features ",xterm-ghostty:RGB"
set -as terminal-features ",xterm-256color:RGB"

# Sane defaults
set -g mouse on
set -g base-index 1
set -g renumber-windows on
set -g history-limit 50000
set -g escape-time 10          # vim-friendly
set -g focus-events on
set -g window-size latest    # each window sizes to its most-recently-active client (tmux >= 3.1 default)

# Bells silenced everywhere
set -g bell-action  none
set -g visual-bell  off
set -g monitor-bell off

Reload & verify

C-arreload config inside running tmux
scripts/test-helpers.shsmoke-tests for status helpers
scripts/test-tmux-ssh-indicator.shSSH-indicator tests (mocks tmux+ps via PATH shim, asserts globe glyph emission)