Skip to content

mux: TUI docs section - #7328

Merged
lawrencecchen merged 4 commits into
mainfrom
feat-mux-tui-docs
Jul 6, 2026
Merged

lawrencecchen merged 4 commits into
mainfrom
feat-mux-tui-docs

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds mux/docs/ as the TUI's own documentation section (getting started, concepts, keyboard, mouse, full mux.json reference, control-socket protocol, browser panes) and slims mux/README.md to an overview with links. Docs-only; every behavioral claim was verified against this branch's code. Targets the feature branch, not main.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
Documentation-only reorganization with no runtime or API code changes.

Overview
Introduces mux/docs/ as the dedicated TUI documentation hub and turns mux/README.md into a short overview with links to build, run, and dev commands.

Content that lived in the monolithic README is split into focused pages: getting started, concepts, keyboard, mouse, full mux.json reference, control-socket protocol v6 (attach streams, events, compatibility), and browser panes. docs/protocol.md notes that mux/spec/ is not in this checkout and points readers at mux-core/src/server.rs as the command source of truth until a formal spec lands.

Reviewed by Cursor Bugbot for commit b3f1ed5. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Documentation
    • Added a new documentation hub for the multiplexer with links to all major help topics.
    • Expanded guides for getting started, build/run usage, configuration, keyboard shortcuts, mouse interactions, browser panes, and the control socket protocol.
    • Clarified session, workspace, pane, and tab behavior, plus attach/detach workflows and default paths.
    • Documented supported key bindings, mouse controls, and browser pane requirements and limitations.

@vercel

vercel Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jul 6, 2026 10:01am
cmux-staging Building Building Preview, Comment Jul 6, 2026 10:01am

@coderabbitai

coderabbitai Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR replaces the extensive mux README with a condensed overview and moves detailed documentation into a new mux/docs/ directory, adding pages for getting started, concepts, keyboard, mouse, configuration, browser panes, and the control socket protocol. No code changes are included.

Changes

Documentation overhaul

Layer / File(s) Summary
Condensed README and docs index
mux/README.md, mux/docs/README.md
Main README shortened to overview plus build/run/development sections; new docs README adds a table of contents linking to detailed pages.
Getting started guide
mux/docs/getting-started.md
Covers prerequisites, local/headless session usage, attach/detach, socket/session path resolution, and dev workflow.
Core concepts documentation
mux/docs/concepts.md
Documents session/workspace/screen/pane/tab hierarchy, focus propagation, tab naming, smart split logic, collapse rules, and PTY vs browser surface behavior.
Keyboard and mouse interaction docs
mux/docs/keyboard.md, mux/docs/mouse.md
Documents prefix-based key routing, default bindings, Alt layer, remapping, and mouse click/drag/scroll/resize/selection/dialog behaviors.
Configuration reference
mux/docs/configuration.md
Documents config file resolution, theme/tabs/sidebar/browser/scrollbar/keys settings, defaults, constraints, and a full example config.
Browser panes and protocol docs
mux/docs/browser-panes.md, mux/docs/protocol.md
Documents CDP-based browser pane lifecycle/endpoint discovery and the JSON Lines control socket protocol (identify, commands, subscribe, attach-surface streaming).

Estimated code review effort: 2 (Simple) | ~10 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Cmux Full Internationalization ❌ Error FAIL: web/app/api/vm/route.ts now exposes raw English err.message in API details.failureMessage, and no next-intl/web/messages locale entries were added. Remove or localize the new failureMessage field, or add matching next-intl keys plus translated entries in every web/messages/*.json locale.
Description check ⚠️ Warning The description summarizes the docs split, but it misses the required template sections for Testing, Demo Video, and Checklist. Rewrite the PR description to follow the template with Summary, Testing, Demo Video, Review Trigger, and Checklist sections.
✅ Passed checks (23 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: reorganizing mux docs into a dedicated TUI documentation section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed Diff touches only README/docs markdown; no .swift files or Swift actor-isolation surfaces were changed.
Cmux Swift Blocking Runtime ✅ Passed The PR diff only changes docs/README files; no Swift files or blocking/timing synchronization were introduced.
Cmux Browser Automation Off-Main ✅ Passed No browser automation code changed in this PR; existing policy/dispatch/tests already route waiting browser.* commands through socketWorkerMethods and the worker router.
Cmux Expensive Synchronous Load ✅ Passed Only Markdown docs changed; no Swift/runtime paths or synchronous loaders were introduced or moved.
Cmux Cache Substitution Correctness ✅ Passed The TS changes use fresh DB reads and retry logic; no cache/opportunistic value replaced an authoritative read in a persistence/history/snapshot path.
Cmux No Hacky Sleeps ✅ Passed PASS: Diff only changes Markdown docs/README; no TS/JS/shell/runtime files or sleep/delay patterns were introduced.
Cmux Algorithmic Complexity ✅ Passed The PR’s runtime changes are linear one-pass parses/updates and test harness code; I found no nested scans, repeated sorts/filters, or per-target rescans on scalable collections.
Cmux Swift Concurrency ✅ Passed No Swift files are in the PR diff; only mux README/docs changed, so the Swift-concurrency rule is not applicable.
Cmux Swift @Concurrent ✅ Passed No Swift files or @concurrent changes appear in the diff, so the Swift concurrent annotation rule isn’t applicable.
Cmux Swift File And Package Boundaries ✅ Passed No Swift files were changed in this PR; the diff is docs/spec/CI/web-only, so the Swift file/package-boundary rule is not applicable.
Cmux Swiftpm Lockfiles ✅ Passed The PR only changes mux docs/README files; no Package.resolved, Xcode, .gitignore, workflow, or dependency files are touched.
Cmux Swift Logging ✅ Passed Diff vs origin/main only touches README/docs markdown; no Swift runtime code changed, so the Swift logging rule isn’t implicated.
Cmux User-Facing Error Privacy ✅ Passed The PR only changes docs/README files, and the rule explicitly allows docs/runbooks; no production user-facing error paths were added.
Cmux Swiftui State Layout ✅ Passed Diff is docs-only (README and mux/docs/*.md); no SwiftUI files or state/layout changes were introduced, so the rule doesn’t apply.
Cmux Architecture Rethink ✅ Passed PR diff only touches docs; merge-base diff shows no .swift files, so Swift architectural-rethink rules don’t apply.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR only changes README/docs; no Swift window/controller code was modified, so the auxiliary-window close-shortcut rule is not implicated.
Cmux Source Artifacts ✅ Passed Changed paths are source, tests, docs, fixtures, and scripts; none are temp/cache/build or other artifact directories.
Cmux No Test Or Debug Seam In Production Source ✅ Passed PR diff only touches mux/README.md and mux/docs/*.md; no production Sources/**/*.swift files or debug/test seams were added.
Cmux No Ambient Global State ✅ Passed No Swift files changed in this PR; the diff is docs/JS/Python only, so the ambient-global-state rule is not implicated.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-mux-tui-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@blacksmith-sh

This comment has been minimized.

@greptile-apps

greptile-apps Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces mux/docs/ as a dedicated documentation section for the cmux-mux TUI, and trims mux/README.md to a short overview with links. No code is changed; all claims were verified against the branch source.

  • Seven new docs pages cover getting started, concepts, keyboard bindings, mouse interaction, the full mux.json configuration reference, the JSON-lines control socket protocol, and browser panes — migrating the detail that previously lived inline in README.md.
  • mux/README.md is slimmed to a one-paragraph description plus links to the new docs, a build snippet, run examples, and dev commands.

Confidence Score: 5/5

Docs-only change with no production code touched; safe to merge.

Every changed file is a Markdown document. No Swift, Rust, TypeScript, or configuration code is modified, so there is no risk to runtime behavior, concurrency, persistence, or security.

mux/docs/protocol.md contains branch-specific wording ("this checkout", "this branch") on lines 802–804 that will read as stale once merged.

Important Files Changed

Filename Overview
mux/README.md Slimmed from a comprehensive inline reference to a brief overview with links to the new docs directory; build/run commands updated and correct.
mux/docs/README.md New docs index page; table-of-contents links are consistent with the files added in this PR.
mux/docs/getting-started.md New getting-started guide covering prerequisites, local session, headless attach, sockets, and dev flow; branch-specific reference on line 575 was flagged in a prior review thread.
mux/docs/concepts.md New concepts doc covering the session tree, focus/active state, tabs, smart split, collapse behavior, and PTY vs browser surfaces; content is accurate and internally consistent.
mux/docs/keyboard.md New keyboard reference covering prefix model, default bindings table, modeless Alt layer, number selection, remapping, and chord format; complete and accurate.
mux/docs/mouse.md New mouse reference covering click targets, drag reorder, scrollbars, resize, context menus, selection/clipboard, pointer shape, and dialogs; complete and accurate.
mux/docs/configuration.md New full mux.json reference with defaults and a worked example; defaults are internally consistent, unknown-key behavior is documented, and the example is valid JSON.
mux/docs/protocol.md New control socket protocol doc covering framing, commands, events, attach stream, and browser limitations; contains branch-specific "this checkout" / "this branch" language on lines 802–804 that will become stale after merge.
mux/docs/browser-panes.md New browser panes doc covering CDP endpoint discovery, rendering, input, profiles/lifecycle, and limitations; accurate and well-structured.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[mux/README.md\noverview + links] --> B[mux/docs/README.md\nindex]
    B --> C[getting-started.md\nbuild, run, attach, sockets]
    B --> D[concepts.md\ntree, focus, tabs, surfaces]
    B --> E[keyboard.md\nprefix, bindings, remapping]
    B --> F[mouse.md\nclick, drag, scrollbars, menus]
    B --> G[configuration.md\nfull mux.json reference]
    B --> H[protocol.md\nJSON-lines socket API]
    B --> I[browser-panes.md\nCDP, rendering, input]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[mux/README.md\noverview + links] --> B[mux/docs/README.md\nindex]
    B --> C[getting-started.md\nbuild, run, attach, sockets]
    B --> D[concepts.md\ntree, focus, tabs, surfaces]
    B --> E[keyboard.md\nprefix, bindings, remapping]
    B --> F[mouse.md\nclick, drag, scrollbars, menus]
    B --> G[configuration.md\nfull mux.json reference]
    B --> H[protocol.md\nJSON-lines socket API]
    B --> I[browser-panes.md\nCDP, rendering, input]
Loading

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Comment thread mux/docs/getting-started.md Outdated
cargo test
```

This branch does not contain `scripts/mux-dev.sh`; use the `cargo run -p mux-tui` commands above for local, headless, and attach workflows.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 This sentence refers to "This branch" as if the reader is on the feature branch, but the note will read as stale and confusing once these docs are merged into main or viewed from any other checkout. Either remove the sentence entirely (the cargo run commands above already cover the workflow) or restate it without the branch reference.

Suggested change
This branch does not contain `scripts/mux-dev.sh`; use the `cargo run -p mux-tui` commands above for local, headless, and attach workflows.
Use the `cargo run -p mux-tui` commands above for local, headless, and attach workflows.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

lawrencecchen and others added 2 commits July 6, 2026 01:54
…, protocol, browser panes)

Written by GPT 5.5 against this branch's code; README slims to
overview + links, all behavior claims verified in-source (protocol v5,
Keys::default bindings, collapse chain, scrollbar drag semantics,
browser endpoints).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…alogs, platform support

Written by GPT 5.5; every claim verified against this branch's code
(protocol 6 + replay-carrying resize frames, non-v6 refusal, key
defaults and alt_shortcuts/array/none config, move_tab/move_workspace
drag paths, TextInput dialogs). README re-slimmed after the merge
overwrote the earlier slimming.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lawrencecchen
lawrencecchen changed the base branch from feat-rust-tui-backend to main July 6, 2026 08:57
@vercel
vercel Bot temporarily deployed to Preview – cmux July 6, 2026 09:41 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@mux/docs/getting-started.md`:
- Around line 46-52: The socket path example in the getting-started docs
conflicts with the actual fallback order. Update the default socket path example
near the socket-path explanation to reflect the full lookup chain used by the
socket resolution logic and smoke-attach behavior, or remove the single-path
example entirely; make sure it aligns with the session-derived path handling in
this section and the fallback order implemented by the socket selection flow.

In `@mux/README.md`:
- Line 35: The README’s socket-path description is incomplete and mismatches the
actual fallback logic used by mux/spec/transports.md and
mux/scripts/smoke-tui.py. Update the documented default socket location to
reflect the real resolution order from XDG_RUNTIME_DIR to TMPDIR to /tmp, and
make the sentence about the default socket path consistent with the socket
lookup implemented by the transport and smoke test code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 92b3da4a-cb93-4c83-af60-1df4e738a095

📥 Commits

Reviewing files that changed from the base of the PR and between 77d3eb8 and b3f1ed5.

📒 Files selected for processing (9)
  • mux/README.md
  • mux/docs/README.md
  • mux/docs/browser-panes.md
  • mux/docs/concepts.md
  • mux/docs/configuration.md
  • mux/docs/getting-started.md
  • mux/docs/keyboard.md
  • mux/docs/mouse.md
  • mux/docs/protocol.md

Comment on lines +46 to +52
The default socket path is:

```text
$TMPDIR/cmux-mux-<uid>/<session>.sock
```

The usual default is `$XDG_RUNTIME_DIR/cmux-mux-<uid>/main.sock` when `XDG_RUNTIME_DIR` is set, then `$TMPDIR/cmux-mux-<uid>/main.sock`, then `/tmp/cmux-mux-<uid>/main.sock`. `--session <name>` changes the final file name. `--socket <path>` bypasses the session-derived path. Server-started child processes receive `CMUX_MUX_SOCKET` with the socket path.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the socket example so it matches the fallback chain.

The block at Lines 46-50 shows only $TMPDIR/..., but the rest of this section and mux/scripts/smoke-attach.py fall back through XDG_RUNTIME_DIR, TMPDIR, and /tmp. Please update or remove the example so it doesn't contradict the actual lookup order.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mux/docs/getting-started.md` around lines 46 - 52, The socket path example in
the getting-started docs conflicts with the actual fallback order. Update the
default socket path example near the socket-path explanation to reflect the full
lookup chain used by the socket resolution logic and smoke-attach behavior, or
remove the single-path example entirely; make sure it aligns with the
session-derived path handling in this section and the fallback order implemented
by the socket selection flow.

Comment thread mux/README.md
```

Colors are `#rrggbb`, `#rgb`, or an xterm-256 index. The selection colors default to the user's Ghostty config (`selection-background`/`selection-foreground` from the platform paths above), falling back to a dark grey. `sidebar_rail` controls the active workspace rail, `sidebar_active_bg` its two-row background, `tab_rail` the active tab chip rail, `tab_bg` inactive solid tab chips, and `tab_active_bg` overrides the focused/unfocused active tab chip backgrounds when set. Tabs are numbered `1 2 3…` by default; recognized agent programs (the `agents` list) surface after the number, `show_titles` restores full process titles, and a user-assigned tab name overrides both. `sidebar.max_width` defaults to `0` for unlimited, while live drag still leaves at least 40 columns for panes. `scrollbar.position` is `"column"` by default or `"border"` for the old right-border overlay. Browser config is optional: `chrome_binary` overrides binary discovery, `cdp_url` accepts `ws://...` or `http://host:port`, `discover` defaults to true, `discover_ports` defaults to `[9222]`, `user_data_dir` overrides the launched profile path, and `ephemeral` restores temporary-profile behavior. When `ephemeral` is true it takes precedence over `user_data_dir`: cmux creates and later deletes a fresh temp profile and never deletes the configured directory. Every prefix/modeless binding is remappable via `keys` (formats: `"c"`, `"%"`, `"ctrl+b"`, `"alt+enter"`, `"tab"`, `"backtab"`, `"pageup"`); values may be a string, an array of strings, or `"none"` to unbind. Set `"alt_shortcuts": false` to remove default Alt chords without blocking user-configured Alt chords. `1`-`9` stay fixed to tab selection. The old key name `"rename-pane"` is still accepted as an alias for `"rename-tab"`.
The default session is `main`. Default sockets live at `$TMPDIR/cmux-mux-<uid>/<session>.sock`; use `--socket <path>` for an explicit path. Detach from an attached TUI with prefix `d`, which is `Ctrl-b d` by default.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the documented socket default with the real fallback order.

mux/spec/transports.md and mux/scripts/smoke-tui.py both resolve the session socket from XDG_RUNTIME_DIR, then TMPDIR, then /tmp, so this README sentence is incomplete and points readers at the wrong path on many hosts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mux/README.md` at line 35, The README’s socket-path description is incomplete
and mismatches the actual fallback logic used by mux/spec/transports.md and
mux/scripts/smoke-tui.py. Update the documented default socket location to
reflect the real resolution order from XDG_RUNTIME_DIR to TMPDIR to /tmp, and
make the sentence about the default socket path consistent with the socket
lookup implemented by the transport and smoke test code.

@lawrencecchen
lawrencecchen merged commit f0c38b8 into main Jul 6, 2026
36 of 38 checks passed

This branch was successfully deployed

1 active deployment
Preview – cmux — b3f1ed58 Deployed Jul 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant