Single Ghostty window, many tmux sessions. Sessions are persistent named workspaces; the Ghostty window is just the current viewport. Closing Ghostty detaches; reopening reattaches to whichever session was last attended. Nothing is lost between Ghostty restarts unless the Mac reboots or you explicitly kill the session.
- Session = a long-lived workspace. Named after a project directory
(
dotfiles,journal-agent, ...) orscratchfor ad-hoc work. - Window = a tab inside a session. Cmd+1..9 jumps directly; Cmd+Shift+[ / Cmd+Shift+] cycles like Safari tabs (configured in Ghostty).
- Pane = a split inside a window.
prefix + |/prefix + -(defaults vary - see your bindings).
The titlebar shows session / window - workspace plus what's currently
running in the focused pane (nvim, fish, etc.). The status-left
shows just the session name as a redundant anchor.
prefix is Ctrl-b (tmux default).
| Binding | What it does |
|---|---|
prefix + f |
Sessionizer. fzf popup of project dirs, pick one to switch-or-create. |
prefix + s |
Tree view of all sessions and their windows. Navigate with hjkl, enter to switch. |
prefix + L |
Jump to the previous session - tmux's cd -. |
prefix + d |
Detach. With exec tmux in fish, this also closes Ghostty. The session keeps running. |
prefix + $ |
Rename the current session. |
prefix + , |
Rename the current window. |
prefix + S |
Stash current window into a bg session (background tunnels etc). |
prefix + r |
Reload tmux.conf. |
- Boot Mac, open Ghostty.
- Fish runs, sees no
$TMUX, ensures ascratchsession exists, attaches to the most-recently-attended session (orscratchon a fresh server). - You're in. Titlebar reads
scratch(or your last project).
prefix + f.- fzf popup shows all dirs from
__fzf_alt_c_source: every git repo under~/Developer,_scratchplaygrounds, host containers, plus~/and its visible direct children (Downloads, Documents, ...). - Type
dot, hit enter ondotfiles. - If
dotfilessession doesn't exist, it's created at the repo root. - Either way,
switch-clientmoves you there. Titlebar updates.
Same as above. The first prefix + f on a fresh repo creates the session
with cwd at the repo root - vim, tests, splits all start there.
Working on dotfiles, need to check something in journal-agent:
prefix + f, pickjournal-agent. Switch.- Look at the thing.
prefix + L(lowercase L). Back todotfiles, exactly where you left it - vim still open, output still on screen.
prefix + L toggles between the last two sessions. Two-handed hop.
prefix + d. Detaches.execexits. Ghostty closes.- Eat.
- Open Ghostty. Lands back in whichever session you were last on. All sessions still running detached in the tmux server.
You need to poke around /var/log or /etc, no project context:
- Option A - stay in
scratch.prefix + f, pick anything matching_scratchor just hit enter on the default.cd /var/log. Sessions don't enforce a directory; they just start there. - Option B - new ad-hoc session via tmux's command prompt:
prefix + :thennew -s logs -c /var/log. Creates and switches. - Option C - from a fresh shell outside tmux:
tmux new -s logs -c /var/log.
When done: tmux kill-session -t logs from anywhere, or just leave it -
it costs almost nothing.
prefix + s opens a tree view. Shows every session, expand to see
windows, hjkl to move, enter to switch, x to kill the highlighted
session/window with confirmation.
tmux ls # list sessions with attach state and last-used time
tmux kill-session -t name # drop one
tmux kill-server # nuke everything (last resort - loses all state)In prefix + s, x on a session kills it after confirmation. Same effect.
This setup is tuned for a single Ghostty. If you open a second one, it attaches to the same session and mirrors the first one - both clients see the same active window. Annoying, not destructive. Close the second window; the first is unaffected. (The previous setup forcibly detached the first, which is why second windows used to feel broken.)
dot-config/fish/config.fish- the attach logic on Ghostty start.dot-config/fish/functions/__tmux_sessionizer.fish- the fzf picker.dot-config/fish/functions/__fzf_alt_c_source.fish- the candidate list, shared withAlt+Cdirectory jump.dot-config/tmux/tmux.conf- theprefix + fbinding, titlebar format, status-left.