auto, tmux, zellij, or none.types.ts
Multiplexer (spawnPane, closePane, applyLayout, isAvailable,
isInsideSession),PaneResult,isServerRunning(serverUrl, timeoutMs?, maxAttempts?) for readiness checks.factory.ts
TMUX, ZELLIJ) is captured accurately.auto mode resolves strictly by env vars and can become no-op none.getAutoMultiplexerType and startAvailabilityCheck for diagnostics.tmux/index.ts (TmuxMultiplexer)
which/where + tmux -V.spawnPane executes opencode attach in a split pane,
sets pane title, and applies layout.closePane sends C-c, waits briefly, then kill-pane.applyLayout handles main layout sizing and rebalance.zellij/index.ts (ZellijMultiplexer)
opencode-agents tab.session-manager.ts (MultiplexerSessionManager)
session.created: spawn pane if enabled and not already tracked,session.status: close on idle, respawn on busy when known,session.deleted: close pane and clear tracking.sessions map),knownSessions),spawningSessions).respawnIfKnown handles busy sessions that reappear after being closed.pollSessions) is enabled when event coverage is incomplete.
It handles:index.ts
src/index.ts reads multiplexer config and creates
MultiplexerSessionManager(ctx, config).getMultiplexer(config) determines backend and whether manager is
enabled (type != none, multiplexer present, running inside session).session.created:
isServerRunning(serverUrl),session.status:
idle → closeSession (close pane + remove mapping),busy → respawnIfKnown if session was previously known.session.deleted:
cleanup() closes all panes and clears tracking maps.src/config multiplexer settings:
type, layout, main_pane_size.src/multiplexer/tmux and src/multiplexer/zellij are used
through the shared abstraction.src/multiplexer/factory.test.tssrc/multiplexer/session-manager.test.ts