From inside tmux
| C-a d | detach |
| C-a s | session picker (tree) |
| C-a $ | rename current session |
| C-a ( / ) | prev / next session |
| C-a L | switch to last session |
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 work | create "work" |
tmux a -t work | attach to "work" |
tmux kill-session -t work | kill "work" |
tmux kill-server | kill all sessions |
tmux-resurrect + tmux-continuum auto-save sessions every 15 min and auto-restore on a fresh server. See the "Persistence" card below for bindings.
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.
Persistence resurrect + continuum
| C-a C-s | save snapshot now (manual) |
| C-a C-r | restore latest snapshot (manual) |
| auto-save | every 15 min (continuum default) |
| auto-restore | on fresh tmux server start (@continuum-restore 'on') |
| snapshots in | ~/.local/share/tmux/resurrect/ |
Defaults only: no @resurrect-processes (panes get fresh shells in cwd; nvim/ssh are NOT relaunched), no @resurrect-capture-pane-contents (scrollback is not saved). Auto-restore only fires on a brand-new server with zero sessions, so attaching to an already-running server (sesh's normal flow) is unaffected.
Dashboard experimental
dashboard '<pattern>' [--cols N] from the shell.
Spawns or rebuilds a dashboard-<derived> session
tiling live capture-pane output for every tmux session
whose name matches the glob. One tile per match; default layout is
tmux's tiled auto-shape. --cols N forces
an N-column grid.
| C-a J | page rows down (no-op outside dashboard-*) |
| C-a K | page rows up |
dashboard --rebuild | re-discover sources, refresh tiles (run inside the dashboard) |
Re-running dashboard '<pattern>' is idempotent —
kills only stale tiles and adds tiles for new matches. Outside tmux
the script attaches; inside tmux it
switch-clients to the dashboard.
Manage
| C-a c | create window — opens at session root (@session_root, set by s) when present, else inherits pane cwd |
| C-a , | rename window |
| C-a & | kill window (confirm) |
| C-a w | window picker (tree) |
| C-a . | move window (renumber) |
Switch
| C-a n / p | next / prev window |
| C-a 1…9 | window 1–9 by number |
| C-a l | last window (but l is also pane-right here — see "Quirks") |
| C-a f | find by name (search) |
Quirk: we rebind C-al to pane-right (vim style). To go to the previous window, use C-an/p or the picker.
Auto-rename (custom)
Window name follows the active pane's last typed command, set by zsh preexec via @last_cmd. Env-var assignments are stripped first; the first two whitespace-separated tokens are used.
vim foo.rb → window name: vim foo.rb
FOO=bar bundle exec rspec → bundle exec
- Idle pane / non-zsh shell → falls back to
pane_current_command (usually zsh)
- Claude session active — window renders
claude[<session-name>] (overrides last-typed-command label until Claude exits)
allow-rename off stays — OSC titles from apps (e.g. Claude Code) cannot override.
Layout
Bottom bar, bg=base02 / fg=base0. Three segments:
- Left: session name on a blue chip with a powerline arrow. Gains a leading globe glyph (
nf-fa-globe) when any attached tmux client is SSH-rooted (drives tmux-ssh-indicator).
- Center (absolute-centered on the full bar): windows. Inactive =
base01 on base02; active = green-on-base3 chip with rounded powerline caps.
- Right: orange PR pin (when the current branch has an open/draft PR) glued to the branch chip via a rounded yellow-on-orange separator. Branch chip is violet for main checkout, yellow for worktree, always flush-right (no closing cap — mirrors the session chip's flush-left anchor). Drives
tmux-status-right → tmux-pr-detect + tmux-git-status.
Solarized palette in use
base03
base02
base01
base0
base2
base3
blue (session)
green (active win)
yellow (worktree branch)
violet (main branch)
orange (PR pin)
cyan (selection)
red
Selection / message style uses cyan-on-base03; pane border switches base01 → blue when active.
Status helpers
~/.config/tmux/bin/tmux-status-right | orchestrator for the right-side status segment — composes PR pin (when present) + git chip flush-right |
~/.config/tmux/bin/tmux-pr-detect | stale-while-revalidate file cache around gh pr view (TTL 60s) — echoes PR number for current branch or empty |
~/.config/tmux/bin/tmux-git-status | git/worktree status segment, colors as args |
~/.config/tmux/bin/claude-tmux-window-name | sets/clears @claude_session_name from Claude Code hooks (drives claude[<name>] window title) |
~/.config/tmux/bin/tmux-ssh-indicator | walks each attached client's ps ancestry; prints + space when any ancestor is sshd/sshd-session — prepended inside the session chip |
scripts/test-helpers.sh | smoke-tests for the helpers |
scripts/test-tmux-pr-status.sh | smoke tests for tmux-pr-detect + tmux-status-right (uses a PATH-shimmed gh) |
Worktree detection uses git rev-parse --git-dir vs --git-common-dir so it works for .claude/worktrees/*, worktrunk paths, and sibling worktrees alike.
| C-ar | reload config inside running tmux |
scripts/test-helpers.sh | smoke-tests for status helpers |
scripts/test-tmux-window-label.zsh | window-label extraction tests (mirror of _tmux_window_label in .zshrc) |
scripts/test-claude-tmux-window-name.zsh | tests for the claude[<name>] window-title helper |
scripts/test-tmux-ssh-indicator.sh | SSH-indicator tests (mocks tmux+ps via PATH shim, asserts globe glyph emission) |