2026-08-09
Divorce — tmux session switcher
A Rust CLI that fuzzy-switches tmux sessions with fzf, or creates sessions named from folder + git branch—with distinct attach vs switch-client behaviour.
Problem
Jumping between tmux sessions is friction: remember names, type tmux switch-client -t …, or leave the keyboard for a mouse menu. Creating a session for “this repo on this branch” is the same ritual every time.
Constraints
- Must work inside and outside tmux (switch-client vs attach).
- Depend only on tools people already have for this workflow: tmux, fzf, git.
- Stay a small Rust binary—no daemon, no config service.
What I built
divorce is a Rust CLI with two primary modes:
divorce fzf— list open sessions (excluding the current one when already inside tmux), pick with fzf, then switch or attach depending on context. Cancel fzf to leave the session unchanged.divorce new— create-or-attach viatmux new-session -A, auto-naming from the project folder and current git branch (or an explicit name).
Optional tmux binding (prefix + d) sources a small conf that runs the fuzzy switcher.
Result
Session hopping and “new session for this worktree” become one keystroke-friendly command instead of a multi-step shell ritual—with behaviour that matches whether you are already attached to tmux.