Problem
When running OmO inside cmux (the native-split Terminal layer), tmux subagent panes are created with a placeholder message ("Focus this pane to attach.") but they never transition to an actual opencode attach session, even when the user focuses the pane.
There are two compounding failure modes:
-
respawn-pane -k is a no-op under cmux __tmux-compat — The activation path in activateFocusedPanes calls activateTmuxPane, which issues a tmux respawn-pane -k <pane_id> command to replace the placeholder with opencode attach. Under cmux, cmux __tmux-compat intercepts all tmux commands and silently discards respawn-pane -k (it has no equivalent native-split operation), so the pane stays on the placeholder forever.
-
Immediate child-exit on focus — In some cmux configurations, focusing the placeholder pane causes the /bin/sh sleep loop to receive a signal or the pane's shell to terminate, killing the placeholder before any activation occurs. The subagent pane disappears on focus.
Root Cause
The placeholder + focus-to-activate design (buildTmuxPlaceholderCommand + activateTmuxPane respawn) assumes a real tmux server that can reuse an existing pane with respawn-pane -k. cmux emulates tmux's split-window for pane creation but does not implement respawn-pane -k. Consequently:
- The pane is created (split-window works ✓)
- The placeholder loop runs (✓)
respawn-pane -k to inject opencode attach is silently dropped (✗)
- The pane remains stuck on the placeholder indefinitely
Proposed Fix
When isCmuxCompatEnvironment() returns true (already exists in packages/tmux-core/src/cmux-detect.ts), skip the placeholder entirely and pass buildTmuxAttachCommand(serverUrl, sessionId, directory) as the initial command to split-window. Simultaneously mark the spawned tracked session with attachActivated: true so the existing activateFocusedPanes guard (if (tracked.attachActivated) continue) skips the respawn attempt automatically.
This is an opt-in, cmux-only path — standard tmux behavior (focus-defer) is unchanged.
Impact
All OmO users running cmux (TMUX contains "cmuxterm" OR CMUX_SOCKET_PATH is set without TMUX) see subagent panes that appear to spawn but never become interactive. The feature is entirely non-functional in this environment.
Environment
- cmux: 0.64.x (cmuxterm native-split mode)
- OmO: dev branch
- Platform: macOS (Apple Silicon), other platforms untested
Relates To
Problem
When running OmO inside cmux (the native-split Terminal layer), tmux subagent panes are created with a placeholder message ("Focus this pane to attach.") but they never transition to an actual
opencode attachsession, even when the user focuses the pane.There are two compounding failure modes:
respawn-pane -kis a no-op undercmux __tmux-compat— The activation path inactivateFocusedPanescallsactivateTmuxPane, which issues atmux respawn-pane -k <pane_id>command to replace the placeholder withopencode attach. Under cmux,cmux __tmux-compatintercepts all tmux commands and silently discardsrespawn-pane -k(it has no equivalent native-split operation), so the pane stays on the placeholder forever.Immediate child-exit on focus — In some cmux configurations, focusing the placeholder pane causes the
/bin/shsleep loop to receive a signal or the pane's shell to terminate, killing the placeholder before any activation occurs. The subagent pane disappears on focus.Root Cause
The placeholder + focus-to-activate design (
buildTmuxPlaceholderCommand+activateTmuxPanerespawn) assumes a real tmux server that can reuse an existing pane withrespawn-pane -k. cmux emulates tmux'ssplit-windowfor pane creation but does not implementrespawn-pane -k. Consequently:respawn-pane -kto injectopencode attachis silently dropped (✗)Proposed Fix
When
isCmuxCompatEnvironment()returnstrue(already exists inpackages/tmux-core/src/cmux-detect.ts), skip the placeholder entirely and passbuildTmuxAttachCommand(serverUrl, sessionId, directory)as the initial command tosplit-window. Simultaneously mark the spawned tracked session withattachActivated: trueso the existingactivateFocusedPanesguard (if (tracked.attachActivated) continue) skips the respawn attempt automatically.This is an opt-in, cmux-only path — standard tmux behavior (focus-defer) is unchanged.
Impact
All OmO users running cmux (
TMUXcontains"cmuxterm"ORCMUX_SOCKET_PATHis set withoutTMUX) see subagent panes that appear to spawn but never become interactive. The feature is entirely non-functional in this environment.Environment
Relates To