feat: add herdr as an alternative multiplexer backend - #304
Draft
rubenfiszel wants to merge 2 commits into
Draft
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
webmux | 22aeeb0 | Commit Preview URL Branch Preview URL |
Aug 06 2026, 09:38 PM |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds herdr as an alternative to tmux for backing a project's panes, selected per project with a new
multiplexer:config key. Default staystmux; omitting the key changes nothing.Verified end to end
Against live herdr 0.8.0 / protocol 19, in an isolated named session:
webmux add feature-x→ one workspace, one tab, 2 panes matching the profile —pane.process_infoconfirmsclauderunning in the agent pane andzshin the shell panewebmux list→open·webmux close→ tab removed ·webmux list→closedwebmux openre-creates the tab; a second worktree adds a second tab to the same workspaceWhat changed
SessionGateway(backend/src/adapters/session-gateway.ts) — the oldTmuxGateway, renamed and made multiplexer-agnostic. Two cleanups came with it:setWindowOptionis gone from the interface.session-serviceno longer pokespane-base-index/automatic-rename/allow-rename;BunTmuxGateway.createWindowapplies them itself. A newfocusWindowreplaces the CLI's hand-rolledtmux select-window.HerdrGateway(backend/src/adapters/herdr.ts) — maps session→workspace, window→tab, pane→pane, joined by label rather than id, because webmux persists names and herdr ids don't survive a restart.herdr 0.8.0 quirks this works around
The socket API accepts more parameters than it honours. Each of these was found by running it, and three of them only surfaced once there was more than one tab in play:
events.subscribeis long-lived.pingreportsdetached_server_daemon: false; everything else returnsserver_not_running. Unliketmux start-server,ensureServer()spawns and detachesherdr serveritself, then polls.pane.listignorestab_id/tab/workspace_idand always returns every pane in the session. The adapter filters by each pane's owntab_id— without this, pane index 0 of a worktree resolves into a different tab.pane.splitignorespane_idand splits whatever pane is focused. The adapter focuses the anchor first and restores prior focus afterwards, preserving tmux's detachedsplit-window -dbehaviour for parked panes.pane.swapneedssource_pane_id/target_pane_id— a shape the CLI doesn't expose, so the adapter uses the socket directly. This is what lets the existing parked-pane tab system work unchanged.pane.send_textandpane.readdo honourpane_id.EXPECTED_PROTOCOLis pinned and a mismatch logs a warning, since herdr is pre-1.0.Not supported in herdr mode: the web terminal
A real limitation, not an oversight. The browser terminal works by attaching a tmux grouped session (
new-session -t+window-size latest) so each tab gets an independently-sized view of a shared window. herdr has no equivalent: no method accepts rows/cols (panes live on a server-side virtual screen), andpane.readis a snapshot rather than an incremental stream. Attaching now returns an explicit error pointing you at your own terminal. Everything else — worktree lifecycle, dashboard, git state, PRs, Linear, conversations — is unaffected.Notes for review
bin/is not covered by anytsconfigand has never been typechecked. I checked it with an ad-hoc config while working: it has 10 pre-existing errors, unchanged by this PR (verified by stashing). Worth a follow-up, out of scope here.Tests
766 pass, 0 fail(738 baseline + 28 new, incl. 24HerdrGatewaytests against a stub socket that reproduces the quirks above). Backend typecheck clean.Docs:
docs/herdr.md.🤖 Generated with Claude Code