# tmux Workflow
Prefix is `C-b`, and only `C-b` — `C-a` is the Kitty prefix (kitty is the
default terminal, SUPER+Return). Alacritty is still installed and opens straight
into tmux, re-attaching the first detached session or starting a new one.
Config: `~/.tmux.conf`, colours in `~/.dotfiles/config/tmux-theme.conf`, palette
`~/.config/tmux/palette.conf` (generated from `theme.nix`, gruvpine now). The
status bar shows the **active engagement target** (from the DB
`~/.pentest/.active`), the VPN IP, time and date, plus a `^A` / `Copy` badge
while the prefix or copy mode is active.
## Key bindings
| Binding | Action |
|---|---|
| `prefix \|` | Split vertical (keep cwd) |
| `prefix -` | Split horizontal (keep cwd) |
| `prefix c` | New window (keep cwd) |
| `prefix h/j/k/l` | Select pane (vim-style) |
| `prefix H/J/K/L` | Resize pane (repeatable) |
| `C-h/j/k/l` | Smart pane switch (vim/nvim aware, no prefix) |
| `prefix r` | Reload config |
| `prefix P` | Launch HTB pentest layout (`scripts/htb-layout.sh`) |
## Pentest plugins
| Binding | Plugin | Action |
|---|---|---|
| `prefix O` | tmux-logging | Toggle logging this pane to `~/.pentest/logs` |
| `prefix M-o` | tmux-logging | Save the visible screen |
| `prefix M-O` | tmux-logging | Save the pane's whole history |
| `prefix M-c` | tmux-logging | Clear the pane's history |
| `prefix Tab` | extrakto | fzf over pane text (Tab inserts, Enter copies) |
| `prefix F` | tmux-fingers | Hint letters over IPs, hashes, URLs, paths; type to copy |
| `prefix C-f` | tmux-fzf | fzf menu: sessions, windows, panes, processes |
| `prefix g` / `C` / `X` / `S` | tmux-sessionist | Go to / create / kill / last session |
| `prefix @` / `t` | tmux-sessionist | Pane to own session / join a pane here |
| `prefix C-s` / `C-r` | tmux-resurrect | Save / restore sessions |
tmux-fingers also matches `LM:NT` pairs and `$…$` crypt hashes. Alacritty has
its own hints outside tmux's keys: `C-S-u` URL, `C-S-i` IP, `C-S-h` hash, `C-S-p` path.
## Copy mode (vi)
`prefix [` enters copy mode. `v` begin selection, `C-v` rectangle, `y` copy to
clipboard (`wl-copy`), `/` `?` incremental search, `Escape` cancel. Mouse is on.
## Pentest session template
```bash
tmux-htb photon # or: prefix P (uses current/default box)
```
Creates session `htb-photon` with windows:
`shell` · `listeners` (split) · `server` (HTTP file server) · `recon` · `docker`.
Re-running attaches if the session already exists.
## Persistence
`tmux-resurrect` + `tmux-continuum` auto-save every 15 min, including pane
contents. Restore is manual (`prefix C-r`). Continuum only auto-saves from the
first tmux server, so one started with `-L` does not overwrite the save.
## Plugins
From nixpkgs, declared in NixDaemon `modules/home/shell.nix` and linked into
`~/.tmux/plugins/` (a stand-in for TPM runs them, so `prefix I`/`U` do nothing).
To add one: add it there, then `nh os switch`.