// ZTMUX — DOCUMENTATION

A from-source Rust port of tmux — the full server + client, ported against the C and verified against the C.

>_WHAT IS THIS

ztmux is a from-source port of tmux to Rust: the server, the client, the grid/screen model, the input parser, layouts, the command language, formats, and the terminal back end. It is not a wrapper around the tmux binary and not control mode — it is the multiplexer itself. Ported forward against the upstream tmux C sources (vendored, read-only, SHA-pinned), correctness is measured: a parity suite runs identical inputs through the real tmux and ztmux and diffs byte-for-byte, and an anti-drift gate fails the build if a Rust function is added with no counterpart in the tmux C source.

Distinct from ztmux-core, a native tmux client engine that speaks the wire protocol to an existing server for GUI hosts — this is the whole server + client.

>_AT A GLANCE

1080/1080
Parity vs tmux next-3.7 (100%)
100%
Functional — server + client
1253
Unit tests
125k
Lines of Rust

>_BEYOND tmux

Owning the whole stack means ztmux can add what the C tmux cannot. These original features live in src/extensions/ and are exempt from the anti-drift gate:

>_CLIENT EXTENSIONS

Beyond the interactive dashboard and switch TUIs, ztmux ships a family of original client subcommands with no tmux counterpart — each one a one-shot that resolves the running server over the structured list-* -o json query layer. The inspection verbs are pipeable tables that also emit -o json / --json; the action verbs are dry-run by default and only mutate when passed -f / --force. They all live in src/extensions/ and are exempt from the anti-drift gate.

// INSPECTION — read-only, pipeable, -o json capable:

CommandDoes
ztmux activeFocused window/pane of every session.
ztmux ageSessions ranked by creation age, oldest first.
ztmux aheadHow far each repo is ahead of/behind upstream.
ztmux alertsWindows with a pending bell/activity/silence alert.
ztmux autonameWindows with a pinned name (automatic-rename off).
ztmux bordersWindows that draw a status line on their pane borders.
ztmux buffersThe server's paste buffers, largest first.
ztmux busyPanes running a program, not idle at a prompt.
ztmux changesUncommitted file count per pane's repo, dirtiest first.
ztmux cmdHistogram of commands running across panes.
ztmux commitThe last commit in every pane's repo.
ztmux conflictsRepos with unresolved merge conflicts.
ztmux connectedAttached clients ranked by connection age.
ztmux constrainAttached clients ranked by screen size, smallest first.
ztmux controlClients attached in control mode (-CC).
ztmux cwdWorking directories in use, busiest first.
ztmux deadDead panes still held open in a window.
ztmux dedupFind redundant panes (same cwd + command).
ztmux densityWindows ranked by pane count, most first.
ztmux destroySessions that self-destruct when the last client detaches.
ztmux detachedSessions with no client attached, freshest first.
ztmux diskFilesystem usage behind each pane's cwd.
ztmux doctorEnvironment / server health check.
ztmux elapsedHow long each pane's process has been running.
ztmux envPer-session environment overrides.
ztmux eventsStream server lifecycle events as JSONL.
ztmux fanoutSessions ranked by total pane count.
ztmux finderSearch panes by command/path/title/window.
ztmux focusThe active pane of every window.
ztmux gitGit branch + dirty state of every pane's repo.
ztmux gonePanes whose working directory no longer exists.
ztmux graphRender the server tree as DOT/Mermaid/HTML.
ztmux grepSearch the live contents of every pane.
ztmux groupsCluster sessions by session group.
ztmux historyRank panes by scrollback buffer size.
ztmux hooksThe command hooks configured on each session.
ztmux idleAttached clients ranked by time since last activity.
ztmux infoDeep inspector for a single pane.
ztmux inputPanes that are ignoring keyboard input.
ztmux keysHow many key bindings live in each key table.
ztmux keytableClients parked on a non-root key table.
ztmux layoutsThe current layout string of every window.
ztmux limitEach session's scrollback capacity, largest first.
ztmux linkedWindows linked into more than one session.
ztmux autolockSessions set to lock themselves after idle time.
ztmux marksThe marked pane(s).
ztmux memPanes ranked by process resident memory.
ztmux modePanes currently frozen in a mode.
ztmux monitorWindows armed to alert on activity or silence.
ztmux mouseWhich sessions have mouse mode enabled.
ztmux namedWindows with a deliberate name, not the running command.
ztmux nestedPanes running a nested terminal multiplexer.
ztmux netEstablished outbound connections per pane.
ztmux peekDump the visible contents of every pane.
ztmux pipedPanes with an active pipe-pane capture.
ztmux portsListening TCP ports mapped to panes.
ztmux projectProject kind and root behind every pane.
ztmux psOne-shot pipeable per-pane process table.
ztmux pstreeProcess tree running under every pane.
ztmux readonlyClients attached in read-only mode.
ztmux recentList sessions ranked by last activity.
ztmux remainWindows that keep panes open after they exit.
ztmux remoteThe git remote each pane's repo points at.
ztmux shellsPanes sitting at a bare shell prompt.
ztmux sizeReport pane geometry, smallest first.
ztmux snapshotDump the whole server as one nested JSON document.
ztmux soloWindows holding a single, unsplit pane.
ztmux sshWhich panes hold an SSH connection, and where.
ztmux startcmdThe command line each pane was launched with.
ztmux stashRepositories with stashed work behind a pane.
ztmux statePanes whose process is in an abnormal state.
ztmux statsOne-shot server summary report.
ztmux statusSessions with the status line turned off.
ztmux submodulesRepos with submodules and how many are out of sync.
ztmux syncWindows with synchronize-panes turned on.
ztmux tagThe git describe/tag context of every pane's repo.
ztmux termHistogram of attached client terminal types.
ztmux titlebarSessions that push a title to the outer terminal.
ztmux titlesEvery pane's advertised title.
ztmux treePrint the session/window/pane tree.
ztmux ttyMap every pane to its terminal device.
ztmux usagePer-session CPU/MEM/RSS resource rollup.
ztmux userThe owner of every pane's process.
ztmux utf8The UTF-8 state of every attached client.
ztmux vcsWhich version-control system each pane is under.
ztmux viewersHow many clients are attached to each session.
ztmux visualSessions that show alerts visually instead of just beeping.
ztmux watchTop-like live per-pane process monitor.
ztmux whoClients attached to the server, by session.
ztmux winsizeWindows whose sizing mode differs from the default.
ztmux worktreePanes sitting in a linked git worktree.
ztmux writablePanes whose working directory is read-only.
ztmux zoomWindows with a zoomed pane.

// ACTIONS — dry-run by default, apply with -f:

CommandDoes
ztmux bcastBroadcast a command to many panes at once.
ztmux clearallFree the scrollback of every pane.
ztmux equalizeRe-balance every multi-pane window's layout.
ztmux layoutApply a named layout preset to a window.
ztmux pickBatch ops over the multi-pane mark set (sync/unmark/clear/list).
ztmux pruneRemove dead/empty/idle server objects.
ztmux reviveRevive every dead pane in place.
ztmux retitleLabel every pane with its running command.
ztmux triggersRun a ztmux command when a regex matches a pane's output (arm/disarm/list/test).

>_SITEMAP

>_QUICK START

CommandDoes
cargo build --releaseBuild the ztmux server + client binary.
ztmux new-session -s workStart a session — identical to tmux.
ztmux list-panes -a -o tableEvery pane as an aligned table (swap -o json for scripts).
ztmux dashboardOpen the live server dashboard.
ztmux switcherFuzzy-jump to any session/window/pane.

>_BUILD

Requires a C libevent and a terminfo database (ncurses), exactly like tmux. On macOS the build links Homebrew's libevent automatically (TMUX_RS_DISABLE_HOMEBREW_LIBS=1 to opt out). The binary is ztmux; it speaks the same client/server protocol as tmux but on its own socket namespace (ztmux-<uid>, resolved from $ZTMUX, never $TMUX) so it never collides with a running tmux. It advertises both $TMUX (ecosystem compatibility) and $ZTMUX (its own handle) to panes, so tools like ztmux-core and zterminal talk to it.