Contributing
τ-mux is a small, opinionated codebase. Contributions are welcome — please skim the constraints below before opening a large PR.
Code style
Section titled “Code style”- TypeScript everywhere, ES modules.
- Minimal dependencies. No frameworks in the webview. xterm.js is the only significant view dep.
- Interface-heavy design, minimal class inheritance.
- Pure parsers. Anything that turns subprocess output into structured maps is a pure function so it can be unit-tested without spawning processes.
- Locale-robustness. Any subprocess whose output we parse runs with
LC_ALL=C, LANG=C. Decimal separators, thousand separators, and date formats vary by locale and have bitten us before. - Error handling. try/catch with graceful degradation. Log errors, don’t throw from callbacks. The metadata poller must never crash the main process — all subprocess runners return empty maps on failure.
- Bun idioms. Use
Bun.file(fd).stream()for reading fds,Bun.write(fd, data)for writing.
Constraints that won’t bend
Section titled “Constraints that won’t bend”- No node-pty.
Bun.spawnwithterminal: trueis the only PTY API. - No React. Vanilla TypeScript + DOM in the webview.
- Keyboard never goes to panels or chips. All keystrokes go to xterm.js → stdin. Panels and chips are mouse-only (chip buttons are keyboard-focusable).
- Each content block is its own DOM element. Independent panels with CSS transforms, not a shared canvas.
- PTY is the source of truth. Canvas panels and metadata chips are ephemeral overlays — they never affect terminal state.
PR workflow
Section titled “PR workflow”-
Branch. From
main. Name itfeature/<short>orfix/<short>. -
Type-check + test.
Terminal window bun run typecheckbun test -
End-to-end test if the change touches the web mirror, the webview, or shortcuts.
Terminal window bun run test:e2e # web mirrorbun run test:native # webview -
Bump the version. Per the project’s CLAUDE.md, run
bun run bump:patch(or:minor/:major) before committing. If you don’t, explain why in the PR. -
Open the PR. Describe the why in 1–2 sentences. Reference the issue or feature plan if applicable.
Reviewing
Section titled “Reviewing”- The
crazyShell Revieweragent (bun run review:agent) runs a proposition-only review on demand and writes dated markdown reports tocode_reviews/. Useful for self-review before pushing. Seedoc/code-review-agent.mdfor the workflow.
Common patterns
Section titled “Common patterns”See Architecture deep-dive for the patterns table:
- Adding a settings field
- Adding a CLI / socket command
- Adding a keyboard shortcut
- Adding a pane-bar chip
- Adding a non-PTY surface kind
tail -f ~/Library/Logs/tau-mux/app-$(date +%Y-%m-%d).logTests redirect to $HT_CONFIG_DIR/logs so the real directory stays clean.
License
Section titled “License”MIT.