Skip to content

feat(mux): add Herdr backend - #3531

Merged
bbedward merged 5 commits into
duxlabs-dev:masterfrom
matthewyjiang:feat/mux-herdr
Sep 21, 2026
Merged

bbedward merged 5 commits into
duxlabs-dev:masterfrom
matthewyjiang:feat/mux-herdr

Conversation

@matthewyjiang

@matthewyjiang matthewyjiang commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

For context, Herdr is a relatively new, popular terminal multiplexer centered around agents, which now has 39k stars. (Herdr GitHub) Personally, this has replaced tmux for me. I wanted to be able to use the DMS mux interface with Herdr.

After this PR, Herdr users can now manage their sessions through the existing mux launcher by selecting herdr in Settings → System → Multiplexers.

In the backend, we:

  • Detect Herdr with command -v herdr and list sessions with herdr session list --json.
  • Attach with herdr session attach NAME or create with herdr --session NAME in the configured terminal.
  • Use herdr session stop NAME for the Kill action. Stopped sessions remain in the list; this action does not delete them.

The existing custom command and session filter apply to Herdr. IPC is unchanged, including dms ipc call mux toggle.

Structure

Adding a third backend by hand would have put a muxType branch in eight places in MuxService.qml. Instead, each backend is one entry in a new Common/MuxBackends.js table: display name, list command, parser, and argv builders for attach, create, kill, and (tmux only) rename. The service looks up backend once and every action reads from it. The settings dropdown lists the table keys.

Side effects of this structural change:

  • One availability Process for the selected backend instead of one per backend. It re-runs when the backend changes, which also allows for detecting new installs after the shell starts. Technically reduces memory if the user doesnt change backend much.
  • The parsers and the session filter are pure functions with a small node test (tests/mux-backends.test.mjs).

Local testing

  • node --test quickshell/tests/*.test.mjs: 197 pass.
  • make lint-qml passes with no warnings.
  • Loaded MuxService in an isolated Quickshell instance with muxType: herdr: availability came back true, refreshSessions listed the live default session, and switching the setting to tmux re-ran the check and flipped displayName and supportsRename.
  • The generated settings search index is up to date.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

Screenshots / video

Selecting Herdr as the multiplexer backend:

Herdr selected as the multiplexer backend

Opening the mux menu through IPC shows the active Herdr session:

Herdr Sessions menu showing the default session as attached

Checklist

AI assistance was used for this PR.

Each backend (tmux, zellij, herdr) is one entry in MuxBackends.js with
its commands and parser, so the service no longer branches on muxType
in eight places and the settings dropdown lists the table keys. One
availability check runs for the selected backend and re-runs when the
backend changes. The herdr parser reads the real {sessions:[...]}
shape only.
@matthewyjiang
matthewyjiang marked this pull request as ready for review September 21, 2026 08:55
@bbedward

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.

Checked: the MuxBackends.js table vs the old per-backend branches (tmux/zellij parser and argv equivalence, session-filter behavior on empty/whitespace/bad-regex input), the availability Process rebind (command binding updates before the deferred running = true, so a backend switch cannot probe the stale binary), backend fallback for an unknown muxType, no remaining references to the removed tmuxAvailable/zellijAvailable, the relative .js import convention, I18n.tr() context on the changed subtitle with catalogs untouched, and the regenerated settings search index matching the new card tags. Model: claude-opus-5.

@bbedward
bbedward merged commit cc8a605 into duxlabs-dev:master Sep 21, 2026
2 checks passed
@matthewyjiang
matthewyjiang deleted the feat/mux-herdr branch September 21, 2026 21:30
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.

2 participants