Skip to main content

Tmux: session picker

The session picker is the daily navigation surface for tmux sessions, git worktrees, and recent directories. It runs in a tmux popup and opens with prefix + T.

Press alt-g to switch to the GitHub picker without leaving the popup loop.

Reading the screen

AreaMeaning
Row listLive sessions, discovered worktrees, and directory shortcuts
BadgesDirty state, stale/gone state, linked PR/issue, review status, and CI
PreviewLast pane output for sessions; git status/commits for worktrees; ls for directories
QueryFuzzy filter; path-like queries turn fzf sorting on for better path ranking

Entry types

KindWhat it representsOn enter
sessionExisting tmux sessionSwitch to it
worktreeGit worktree discovered on diskCreate/focus the canonical tmux session
dirDirectory from scan roots, zoxide, or $HOMECreate/focus a tmux session at that path

Rows are de-duplicated by path with priority session > worktree > dir.

Important bindings

KeyAction
enterSwitch to or create/focus the selected session
tabMark/unmark row for batch actions
ctrl-xKill selected sessions with optimistic hide
alt-xRemove selected worktrees with optimistic hide
ctrl-sEnter send-command mode for selected rows
alt-cCreate a worktree off the selected repo
alt-oCycle all → dirty → review-needed → all
ctrl-rQuick refresh plus background full refresh
alt-rForce full refresh
alt-p / alt-iOpen linked PR / issue in the browser
alt-gSwitch to GitHub picker
ctrl-/Toggle preview
?Show keybinding help in the preview

The GitHub picker reuses many keys but rebinds alt-r to quote-reply. See GitHub picker bindings.

Badges

BadgeMeaning
Dirty tracked changes
⚠ staleWorktree directory exists but gitdir target is missing
✗ gonePath no longer exists on disk
PR / issue iconsBranch has linked GitHub context
approved / changes requested / pendingPR review state
green/red/yellow CI dotSuccess, failure, or pending CI

Session entries inherit the state of their backing worktree.

Preview behavior

Selected rowPreview shows
SessionActivity classification, running command, session path, window count, and last non-blank pane lines
Worktree / git dirPath, branch, ahead/behind, status changes, and recent commits
Stale worktreeDiagnostic plus directory contents
Non-git dirDirectory listing

Activity is classified coarsely: agent panes, idle shells, editors, or busy commands.

Detailed mechanics

The implementation details live in Session picker mechanics:

  • send-command dispatch and selection snapshotting.
  • popup geometry, scan roots, appearance, cache, and live-refresh options.
  • frecency, path-aware sorting, view filters, and worktree creation.
  • refresh/cursor behavior, cache files, worktree discovery, session naming, and stale-worktree safety.