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; dirty/unpushed rows ask before force
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.