docs(docs): expand terminal and tmux documentation with launch commands, prompts, persistence, and keybinding updates

This commit is contained in:
Prad Nukala committed 2026-10-08 11:29:11 -04:00
1 parent ce9886c2e7
commit 9e227b416d
10 files changed
+106 -76

No files matched your search

+57 -40
View File
@@ -1,62 +1,75 @@
---
title: tmux
description: tmux prefix, options, bindings, tpm plugins and the dotbar status line.
description: tmux prefix, bindings, kitty-style window tabs with Nerd Font icons, and resurrect/continuum persistence.
---
Terminal multiplexer. Used locally through the kitty tmux host (`super+t` in [kitty](/terminal/kitty)) and remotely on goliath.
Terminal multiplexer. [Ghostty](/terminal/ghostty) runs nothing but tmux, and Ghostty's `ctrl+shift` chords are tmux bindings. tmux is also used through the kitty tmux host and remotely on goliath.
| | |
| --- | --- |
| Source | `dot_config/tmux/tmux.conf`, `dot_config/tmux/tmux-nerd-font-window-name.yml`, `dot_config/tmux/executable_niri-title.sh` |
| Target | `~/.config/tmux/` |
| Source | `dot_config/tmux/tmux.conf`, `dot_config/tmux/tmux-nerd-font-window-name.yml`, `dot_config/tmux/executable_tab-label.sh`, `dot_config/tmux/executable_niri-title.sh`, `dot_config/omarchy/themed/tmux.conf.tpl`, `dot_config/omarchy/hooks/theme-set.d/executable_tmux-tabs` |
| Target | `~/.config/tmux/`, `~/.config/omarchy/` |
| Install | `tmux` in `.chezmoidata/packages.yaml` (pacman, brew) |
tpm is a `git-repo` external in `.chezmoiexternal.toml`, cloned to `~/.config/tmux/plugins/tpm` when missing. `tmux.conf` ends with `run '~/.config/tmux/plugins/tpm/tpm'`. Plugins tpm installs (`prefix I`) land next to it and are ignored by chezmoi. [Ghostty](/terminal/ghostty) starts every surface in `tmux new-session -A -s main`.
tpm is a `git-repo` external in `.chezmoiexternal.toml`, cloned to `~/.config/tmux/plugins/tpm` when missing. `tmux.conf` ends with `run '~/.config/tmux/plugins/tpm/tpm'`. Plugins installed by tpm (`prefix I`) land next to it and are ignored by chezmoi.
## Options
The prefix is the default `ctrl+b`.
The prefix is `ctrl+space`; `ctrl+b` is `prefix2` (the byte Ghostty sends).
| Option | Value |
| --- | --- |
| `default-terminal` | `tmux-256color`; `xterm-kitty:Tc` override; features `RGB:usstyle:hyperlinks:clipboard:extkeys` |
| `extended-keys` | `always`, format `csi-u` |
| `default-terminal` | `tmux-256color`; `RGB` override for every terminal; `clipboard` feature; `extkeys` for xterm-kitty |
| `extended-keys` | `on`, format `csi-u` |
| `base-index` / `pane-base-index` | `1` / `1`; `renumber-windows on` |
| `status-position` | `top` |
| `allow-passthrough` | `on` (kitty graphics for yazi previews); `TERM`, `TERM_PROGRAM` added to `update-environment` |
| `set-clipboard` | `on` (OSC 52) |
| `mouse` | `on` |
| `status-position` | `top`, `status-interval 5` |
| `allow-passthrough` / `set-clipboard` / `mouse` / `focus-events` | `on` |
| `update-environment` | `TERM` and `TERM_PROGRAM` appended, so programs see the outer terminal (Ghostty/kitty) |
| `mode-keys` | `vi` |
| `set-titles` | `on`, `set-titles-string "#T (#S)"`, `status-interval 1`, `automatic-rename on` |
| `set-titles` | `on`, `#h:#W` |
| `automatic-rename-format` | `#{window_icon} <label>`: Nerd Font icon, then the dynamic label described under [Window tabs](#window-tabs) |
| `history-limit` | `50000` |
| Styling | `status-style` and `popup-style` use default bg; popup border rounded, `fg=#5c5c66` |
| `detach-on-destroy` | `off` (killing a session switches to another instead of detaching) |
These settings are what [yazi](/tools/yazi) needs inside tmux. `allow-passthrough` carries image previews through to the terminal, `set-clipboard` copies paths via OSC 52, and the two environment variables let yazi detect the outer terminal's graphics support. Nothing binds `M-[`: tmux would read the `ESC [` that starts yazi's terminal-query replies as that key and break yazi's capability detection.
## Keybindings
| Key | Action |
| --- | --- |
| `S-Enter` (no prefix) | Sends `Esc [13;2u` |
| `prefix t` | New window in pane cwd; on sessions with `@ssh_host` set (by the Vicinae tmux-sessions extension), runs `ssh <host>` instead |
| `prefix [` / `prefix H` | Previous window |
| `prefix ]` / `prefix L` | Next window |
| `prefix %` | Split right, 30% width, pane cwd |
| `prefix "` | Split below, 25% height, pane cwd |
| `prefix Escape` | Copy mode |
| `ctrl+h/j/k/l` (no prefix) | Select pane left/down/up/right, or forward the key if the pane runs vim/nvim/fzf (`is_vim`) |
| `prefix ctrl+l` | Send `ctrl+l` (clear screen) |
| `prefix o` | tmux-sessionx picker (`@sessionx-bind`) |
| `C-Space` (no prefix) | tmux-palette |
| `M-f` / `M-m` | tmux-palette find pane / move pane |
### Copy mode (vi)
`prefix ?` opens all of them in a popup (`omarchy-menu-tmux-keybindings`).
| Key | Action |
| --- | --- |
| `v` | Begin selection |
| `y` | Copy to `wl-copy` and exit |
| `Y` | Copy to `wl-copy` and cancel |
| Mouse drag end | Copy to `wl-copy` |
| `ctrl+h/j/k/l` | Select pane |
| `prefix q` | Reload config |
| `prefix /` | Copy mode, then search upward |
| `prefix o` | tmux-sessionx: fuzzy-find, switch to, create, rename (`ctrl-r`), or kill (`alt-backspace`) sessions, with a preview |
| `prefix h` / `prefix v` | Split below / right, pane cwd |
| `prefix x` | Kill pane |
| `M-Enter` / `M-S-Enter` / `M-Escape` (no prefix) | Split below / split right / kill pane |
| `C-M-arrows` / `C-M-S-arrows` (no prefix) | Focus pane / resize pane by 5 |
| `prefix c` / `prefix k` / `prefix r` | New window in pane cwd / kill window / rename window |
| `M-1` … `M-9` (no prefix) | Select window 1–9 |
| `M-Left` / `M-Right` (no prefix) | Previous / next window |
| `M-S-Left` / `M-S-Right` (no prefix) | Move window left / right |
| `prefix C` / `prefix K` / `prefix R` | New / kill / rename session |
| `prefix P` / `prefix N`, `M-Up` / `M-Down` | Previous / next session |
| Copy mode `v` / `y` | Begin selection / copy and exit |
## Window tabs
The status line copies kitty's tab bar (`tab_bar_style powerline`, `tab_powerline_style angled`). The current window is an accent-tinted plate with accent text. The other windows use `bg=default` and muted text, so the terminal's transparency shows through them, as with kitty's `tab_bar_background none`. As in kitty, a solid arrow leads into the current window and a thin one sits between two inactive windows. The arrow into the current window is its notch, drawn with the inverse glyph `U+E0D6` in the plate color, which keeps the notch transparent. The session name is an accent pill on the far left (`status-justify left`); its arrow points straight into the first tab, so the pill and tabs read as one chain of arrows. The right side shows `COPY`/`PREFIX`/`ZOOM` flags and the hostname.
Colors are the user options `@tab-bg` (the session pill's text), `@tab-fg`, `@tab-active-bg`, and `@tab-active-fg`. `tmux.conf` sets cyberdream defaults, then sources `~/.local/state/omarchy/current/theme/tmux.conf` if it exists. Omarchy renders that file from `~/.config/omarchy/themed/tmux.conf.tpl`, using the same derivation as the kitty tab bar (active background = accent mixed 20% into background). On a theme change, the `theme-set.d/tmux-tabs` hook re-sources it into the running server, so the tabs recolor like kitty's.
### Tab labels
Each window reads `<index> <icon> <label>`, updating as you work, the same rule as kitty's `tab_bar.py`:
| Pane runs | Label | Source |
| --- | --- | --- |
| `nvim`/`vim`/`hx`/`helix`, editing a file | The file name | The title nvim sets (`<file> \| <org/repo>`, astrocore `custom_title`), read from `#{pane_title}` by the format itself, so a buffer switch relabels the tab immediately |
| Anything else, or an editor with no file | Repo the cwd belongs to (walks up for `.git`); the directory name outside a repo; `~` at home | `tab-label.sh`, run as an async `#()` job. When its output differs from the current name, it re-arms `automatic-rename` so tmux relabels right after a `cd` instead of on the next keystroke |
Labels longer than 27 characters end in `…`. The icon comes from tmux-nerd-font-window-name.
## Plugins
@@ -64,22 +77,26 @@ The prefix is the default `ctrl+b`.
| --- | --- |
| `tmux-plugins/tpm` | Plugin manager |
| `tmux-plugins/tmux-sensible` | Defaults |
| `joshmedeski/tmux-nerd-font-window-name` | Fills `#{window_icon}` from `tmux-nerd-font-window-name.yml` |
| `tmux-plugins/tmux-resurrect` | `@resurrect-capture-pane-contents on` |
| `tmux-plugins/tmux-continuum` | `@continuum-save-interval 10`, `@continuum-restore on` |
| `omerxx/tmux-sessionx` | `@sessionx-bind o`; `@sessionx-zoxide-mode on` (a query that matches no session is resolved through zoxide into a new session); `@sessionx-fzf-builtin-tmux on` (`fzf --tmux` popup; needs fzf ≥ 0.53, bat for previews) |
### Status line (dotbar)
### Persistence
Top, rounded, centered (`absolute-centre`), left section on, right off, session on the left. Colors: bg `#0B0E14`, fg `#475266`, current `#BFBDB6`, session `#565B66`, prefix `#95E6CB`. Window format ` #W ` separated by ` • `; right text ` %H:%M `. Bold off. SSH indicator enabled with an icon; maximized icon only on the zoomed tab.
resurrect saves sessions, windows, panes, cwds, pane contents, and a default set of programs (nvim, less, man, …). Keys: `prefix C-s` saves, `prefix C-r` restores. continuum saves automatically every 10 minutes. When a tmux server starts and no other tmux server is running, continuum restores the last save. In practice that means the first Ghostty window after login or a reboot.
## tmux-nerd-font-window-name.yml
`show-name: true`, icon on the left, a fallback icon, blank multi-pane icon. Icons are defined for `mprocs`, `mm`, `macmon`, `make`, `zsh`, `nvim`, `devbox`, `psql`, `yazi`, `lazygit`, `gh`, `tv`, `docker`, `bun`, `node`, `npm`, `pnpm`, `go`, `bunx`, `claude`.
`show-name: false`, because `automatic-rename-format` supplies the label. The icon sits on the left, with a fallback icon and a blank multi-pane icon. Icons are defined for `mprocs`, `mm`, `macmon`, `make`, `zsh`, `nvim`, `devbox`, `psql`, `yazi`, `lazygit`, `gh`, `tv`, `docker`, `bun`, `node`, `npm`, `pnpm`, `go`, `bunx`, and `claude`. The plugin parses the YAML with awk and does not interpret `\U` escapes, so the glyphs are literal characters.
## niri-title.sh
Installed only on Linux `desktop`/`laptop` roles (gated in `.chezmoiignore.tmpl`). Given the pane command, path, tty and title, it prints a context segment for the window title read by [Niri](/desktop/niri), by priority:
Installed only on Linux `desktop`/`laptop` roles (gated in `.chezmoiignore.tmpl`). Given the pane command, path, tty, and title, it prints a context segment for the window title read by [Niri](/desktop/niri). It picks the first match:
1. `ssh`/`mosh-client`/`autossh`/`et`: the remote target.
2. `nvim`/`vim`: the pane title (current file).
3. Git repo: directory name and branch.
4. Otherwise the cwd basename.
`tmux.conf` does not currently call the script; its title string is `#T (#S)`.
`tmux.conf` does not currently call the script; its title string is `#h:#W`.