Contributing
Issues and pull requests are welcome. For bugs, include your OS, terminal
emulator, bmux version, and steps to reproduce.
Build from a checkout (requires Go 1.26+) and run the checks:
To preview user docs or regenerate the 2× Retina documentation screenshots:
Read AGENTS.md and the architecture guide before changing terminal or session behavior.
OpenCode integration validation
Section titled “OpenCode integration validation”Install Node.js to run the generated plugin event fixtures in go test (they
skip when Node is absent). To check the installed artifact against OpenCode’s
real loader and public form events, use Python 3 and an OpenCode V2 binary:
The script starts a throwaway private server with an isolated home, database
and config inside the checkout, and a recording fake bmux on PATH. It does
not inherit provider credentials or modify/restart the shared service. Pass
--v1 and a V1 binary path to smoke-test V1 plugin initialization. Failures
save private server diagnostics locally in .opencode-validation-error-v1.log
or .opencode-validation-error-v2.log; review and redact before sharing them.
Releases are built by GoReleaser
from a tag; see Releasing. goreleaser release --snapshot --clean
builds the same archives locally into dist/.
Workflow
Section titled “Workflow”File a GitHub issue for every bug or feature before fixing it, labeled bug or
enhancement, with Problem, Cause, Expected and Done when sections. Never
commit to main: work on a feat/, fix/ or docs/ branch and open a pull
request that closes its issues with Fixes #N.
Fuzzing
Section titled “Fuzzing”Fuzz targets try random input where a crash would take the server down: the
terminal emulator (everything programs print), Kitty image commands, requests
to a session, config files, key names, #{...} formats and CLI targets.
go test ./... runs each one’s seeds and saved crashes; to fuzz one, name it
and give it time:
The others are FuzzKittyCommands (internal/graphics), FuzzSessionRequests
(internal/server), FuzzLoad and FuzzKeyName (internal/config),
FuzzExpand (internal/format) and FuzzParseTarget (cmd/bmux). A crash
writes its input to the package’s testdata/fuzz/. Commit that file with the
fix, so the input runs as a regression test from then on.
Conformance
Section titled “Conformance”esctest checks how a terminal
answers several hundred escape sequences. scripts/esctest.sh runs it inside a
bmux pane, so it tests bmux’s emulator, and prints the summary; each failure’s
details go to esctest.log. Pass a regular expression to run some tests, for
example scripts/esctest.sh 'CUUTests|EDTests'. It needs Python 3 and tmux.
Compare the summary before and after an emulator change: the pass count
shouldn’t drop. Many failures are xterm features bmux doesn’t implement, such
as window operations and palette changes.
Comparing with tmux
Section titled “Comparing with tmux”To capture CPU and allocation profiles for a particular workload, see CPU and allocation profiles. Profile the client and server separately before selecting an optimization.
scripts/compare-tmux.py measures bmux from your checkout against the installed
tmux and prints Markdown tables for three things:
- keystroke echo latency, through an attached client;
- how long
seq 1 1000000takes to display; - server memory, idle, with scrollback at 80 and 200 columns, and with 20 sessions.
Each program gets a throwaway socket and config and a client in a pty, and
tmux’s history-limit matches bmux’s scrollback.lines. A full run takes a
few minutes; --quick takes about one. It needs Go, tmux and Python 3. Run it
before and after a change to the server, the client or the emulator to see
its effect.
Releasing
Section titled “Releasing”A release is a tag on main. Pushing it runs CI and then GoReleaser
(.github/workflows/release.yml), which uploads bmux_<os>_<arch>.tar.gz for
Linux and macOS on amd64 and arm64, plus checksums.txt, to a draft
release. Nothing is public—and the Homebrew tap is not updated—until you publish
the draft. The version comes from the tag: no file in the code holds it.
You need push access and the GitHub CLI (gh),
logged in. Set the version once; the commands below use it:
1. Pick the version
Section titled “1. Pick the version”bmux is 0.x, and every release is a pre-release. Bump the patch number for
anything within the current roadmap milestone, and the minor number when a
milestone ships (v0.6 is scripting). Check whether the protocol changed since
the last release; the release notes must then say to run bmux restart:
It prints the old and new const Version lines when the protocol changed, and
nothing when it didn’t.
2. Release pull request
Section titled “2. Release pull request”main only changes through pull requests, so the release commit is one too.
Check that main is green first (gh run list --branch main --limit 3).
Update:
CHANGELOG.md: add a new## vX.Y.Z — YYYY-MM-DDsection at the top.ROADMAP.md: update the Shipped row under Now, next, later and add a bullet or row under Already built when a milestone lands.site/src/pages/index.astro: bump thevX.Y.Zrelease pill in the nav and hero eyebrow.- Any docs example that names a version that doesn’t exist yet, such as
BMUX_VERSION=ininstall.shand the installation page.
3. Tag and build
Section titled “3. Tag and build”Tag the merge commit on main with an annotated tag:
Wait a few seconds for the run to start, then watch it:
4. Check the draft
Section titled “4. Check the draft”It should hold five files, and every archive should match checksums.txt:
bmux --version must print the version without the v.
5. Notes and publish
Section titled “5. Notes and publish”Write the notes in a file, following the earlier releases: a one-line summary;
the install commands (the curl … install.sh | sh line and
go install github.com/bmux-dev/bmux/cmd/bmux@vX.Y.Z); then New,
Changed and Fixed lists as they apply; and an Upgrading line that
says whether the protocol changed and, if it did, to run bmux restart
(programs running in panes end; sessions, windows, layouts, directories and
agent conversations come back).
Publishing a stable release automatically updates Casks/bmux.rb in
bmux-dev/homebrew-tap (so aborting a draft never touches Homebrew). For 0.x
pre-releases:
For non-prerelease (1.0+) releases, mark the release as latest instead:
6. Try it
Section titled “6. Try it”It should install the new version. From the previous release, bmux update --check
should offer it.
7. Record its fixtures
Section titled “7. Record its fixtures”The compatibility tests keep every release’s
save file, config and command list working. Record the new one’s, in a pull
request like any other change (it needs tmux):
Beta releases
Section titled “Beta releases”To test an upgrade end to end without publishing a stable release or pushing to
Homebrew, trigger the Beta workflow (.github/workflows/beta.yml) from GitHub
Actions or with gh workflow run beta.yml:
The workflow runs CI, pushes the v...-beta.N tag, builds the archives, and
publishes them as a pre-release without touching Homebrew. Install or test with
bmux update --beta && bmux restart, and switch back with
bmux update --stable && bmux restart.
When something fails
Section titled “When something fails”-
Before publishing (CI fails, GoReleaser fails, the draft looks wrong): nothing is public. Delete the draft and the tag, fix it in a pull request, and start again at step 3:
-
After publishing: don’t move or reuse the tag. Go’s module proxy keeps the first commit it saw for each version, so
go install …@vX.Y.Zwould no longer match the release. Fix it in a new patch release.