- Add 5-minute per-host cooldown for remote error notifications
- Add exponential backoff (capped at 60s) to proxy broker and session controller retries
- Add default SSH ConnectTimeout/ServerAliveInterval/ServerAliveCountMax to detect dead connections faster
- Fix error status clearing to only reset on actual .connected state
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Improve cmux omo error when opencode is not installed
On a fresh computer without opencode, cmux omo would fail with the
unhelpful "Failed to launch opencode: No such file or directory".
Now checks for opencode before doing setup work and shows install
instructions: npm install -g opencode-ai
* Show npm install progress and improve first-run experience
On first run, npm install oh-my-opencode can take 30+ seconds.
Previously piped to /dev/null, making it look like cmux omo hung.
Now pipes npm output directly to stderr so users see progress.
Also improves the message: "this may take a minute on first run".
* Move opencode check before plugin setup to fail fast
---------
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
* CLI: add --no-focus flag to cmux ssh
When cmux ssh is used from a script, workspace.select is called
immediately after workspace.remote.configure, stealing the user's
active workspace focus before SSH is established.
Add --no-focus flag (consistent with break-pane/join-pane) to skip
the workspace.select call so the caller's workspace retains focus.
The caller can then redirect to the new workspace later via
cmux select-workspace.
Addresses cmux ssh case of #140; complementary to #1418.
* CLI: add test coverage for --no-focus flag parsing
- Fix existing test that constructs SSHCommandOptions directly
(add noFocus: false to the initializer call)
- Make parseSSHCommandOptions internal so it's accessible from tests
- Add testParseSSHCommandOptionsNoFocusFlag covering:
- flag sets noFocus=true, destination parses correctly
- absent flag defaults noFocus=false
- combined with --name and --port
* Update CLI/cmux.swift
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Add --no-focus to top-level ssh help synopsis
---------
Co-authored-by: Łukasz Majcher <lukasz.majcher@samsara.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
* Fix tmux compat store decoding, layout cleanup, and cross-workspace fallback
Three hardening fixes for the tmux compatibility layer:
1. Add custom init(from:) to TmuxCompatStore using decodeIfPresent so
older store files missing mainVerticalLayouts/lastSplitSurface keys
decode gracefully instead of silently resetting to an empty store.
2. Clear mainVerticalLayouts entry when a non-main-vertical layout is
selected, preventing stale state from redirecting future splits.
3. Only enter caller-anchoring block in split-window when
resolveWorkspaceId succeeds, avoiding cross-workspace splits when
the fallback target.workspaceId differs from the caller's workspace.
* Add auto-equalize after teammate splits
After each teammate split-window, call workspace.equalize_splits with
orientation: "vertical" to evenly distribute panes in the agent column
without affecting the leader/column horizontal divider.
Uses the equalize_splits socket method from the omo integration
(PR #2087). The equalization works synchronously because bonsplit's
setDividerPosition sets ratios on the internal split state directly,
no layout flush needed.
* Refactor: DRY up claude-teams and omo shared launcher code
Extract shared functions from the nearly-identical claude-teams and omo
integration code:
- configureTmuxCompatEnvironment: parameterized env setup (tmux path
prefix, bin env var, term override, extra vars)
- createTmuxCompatShimDirectory: shared tmux shim creation with
writeShimIfChanged
- resolveExecutableInSearchPath: generic PATH search with optional
skip predicate
- Rename ClaudeTeamsFocusedContext -> TmuxCompatFocusedContext,
claudeTeamsFocusedContext -> tmuxCompatFocusedContext,
claudeTeamsResolvedSocketPath -> tmuxCompatResolvedSocketPath
Both integrations are now thin wrappers over the shared functions.
No behavior changes.
* Address PR review comments: store load, stale state, pane targets
1. Move loadTmuxCompatStore() inside the caller-anchoring if-let so
it's only called when env vars are present (avoids unnecessary
file I/O on non-agent splits).
2. Clear lastSplitSurface alongside mainVerticalLayouts when switching
away from main-vertical layout, preventing stale seed values on
re-entry.
3. Resolve select-layout -t via tmuxResolvePaneTarget first (tmux
accepts pane targets like %1), falling back to workspace target.
Removes duplicate workspace resolution in the else branch.
* Fix select-layout -t fallback: don't apply to wrong workspace
When an explicit -t target fails to resolve, error instead of silently
falling back to the caller's current workspace. Only use the current
workspace as default when no -t was provided.
---------
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
* Add `cmux omo` command for OpenCode + oh-my-openagent integration
Same pattern as `cmux claude-teams`: creates a tmux shim so
oh-my-openagent's TmuxSessionManager spawns agents as native cmux
splits instead of tmux panes. Sets TMUX/TMUX_PANE env vars, prepends
shim to PATH, and execs into opencode.
Closes https://github.com/manaflow-ai/cmux/issues/2085
* Auto-install oh-my-opencode plugin when running cmux omo
Before launching opencode, cmux omo now:
- Checks if oh-my-opencode is registered in ~/.config/opencode/opencode.json
- If not, creates/updates the config with the plugin entry
- Checks if the npm package is installed in node_modules
- If not, runs bun add (or npm install) to install it
- Then proceeds with tmux shim setup and exec
* Use shadow config dir to avoid modifying user's opencode setup
Instead of writing directly to ~/.config/opencode/opencode.json,
cmux omo now creates a shadow config at ~/.cmuxterm/omo-config/ that
layers oh-my-opencode on top of the user's existing config. Symlinks
node_modules, package.json, bun.lock, and plugin config from the
original dir. Sets OPENCODE_CONFIG_DIR to the shadow directory.
Running plain `opencode` remains unaffected.
* Add Agent Integrations docs section with Claude Code Teams and oh-my-opencode pages
Adds sectioned sidebar navigation to the docs site. The new Agent
Integrations section contains separate pages for cmux claude-teams and
cmux omo, documenting usage, tmux shim mechanics, directory layout,
environment variables, and the shadow config approach. Both pages
include a nightly-only warning. Full English and Japanese translations,
nav item keys added to all 19 locales.
* Remove uppercase from sidebar section headers
* Add more spacing above and below sidebar section headers
* Enable tmux mode in oh-my-opencode config, improve docs
- cmux omo now writes tmux.enabled=true to the shadow oh-my-opencode.json
config. Without this, oh-my-openagent's TmuxSessionManager won't spawn
visual panes even though $TMUX is set (the config defaults to false).
- Nightly warnings now link to /nightly instead of generic text.
- Added "What you get" section to oh-my-opencode docs explaining the
visual pane behavior (auto-layout, idle cleanup, queueing).
- Added tmux.enabled step to first-run and how-it-works sections.
* Add terminal-notifier shim to route oh-my-openagent notifications to cmux
oh-my-openagent sends macOS notifications via terminal-notifier
(args: -title <t> -message <m> [-activate <id>]). The shim in
~/.cmuxterm/omo-bin/terminal-notifier intercepts these calls and
routes them through cmux notify, so notifications appear in cmux's
sidebar panel instead of as raw macOS notifications.
* Add pane geometry to tmux-compat for oh-my-openagent grid planning
oh-my-openagent's TmuxSessionManager needs pane geometry (columns,
rows, position, window dimensions) to decide where to spawn agent
panes. Without this data, agents run headlessly.
Server side:
- pane.list v2 response now includes pixel_frame, cell_size, columns,
rows per pane, plus container_frame at the top level
- Uses BonsplitController.layoutSnapshot() for pixel geometry and
ghostty_surface_size() for terminal grid dimensions
CLI side:
- tmuxEnrichContextWithGeometry() computes character-cell positions
from pixel frames and cell dimensions for tmux format variables
(pane_width, pane_height, pane_left, pane_top, pane_active,
window_width, window_height)
- list-panes now resolves pane targets (%uuid) via tmuxResolvePaneTarget
instead of failing with "Workspace not found"
- display-message enriched with geometry for format strings like
#{pane_width},#{window_width}
- tmux -V now returns "tmux 3.4" (needed by oh-my-openagent's
tmux-path-resolver verification)
* Add socket tests for tmux-compat pane geometry
6 tests verifying the geometry enrichment works end-to-end:
- pane.list returns pixel_frame, columns, rows, cell_size, container_frame
- tmux -V returns version string
- list-panes -F renders geometry format variables as integers
- list-panes -t %<uuid> resolves pane targets
- display -p renders pane_width and window_width
- After split, two panes have different positions and halved widths
All 6 pass on macmini (cmux-macmini).
* Handle tmux -V in shim script directly (no socket needed)
oh-my-openagent's tmux-path-resolver runs tmux -V to verify the binary
works. The __tmux-compat handler requires a socket connection, which
may not be established at verification time. Handle -V in the bash
shim directly to avoid the socket dependency.
* Lower default tmux pane min widths for cmux omo
oh-my-openagent defaults: main_pane_min_width=120, agent_pane_min_width=40,
requiring 161+ columns. Most terminal windows are narrower, causing
decideSpawnActions to return canSpawn=false and defer agents forever.
cmux omo now sets: main_pane_min_width=60, agent_pane_min_width=30,
main_pane_size=50, requiring only 91 columns. Also moved tmux -V
handling into the bash shim to avoid needing a socket connection for
the version check.
* Resolve merge conflicts with main (main-vertical layout, focus param)
- Keep upstream main-vertical layout anchoring from #2119
- Keep upstream focus param (v2Bool) instead of no_focus
- Combine with our -d flag handling: -d sets focus=false
- Include customCommands nav item from main
* Implement select-layout equalize and resize-pane absolute width
When oh-my-openagent spawns agent panes, it calls select-layout
main-vertical after each split to redistribute panes evenly, then
resize-pane -x <columns> to set the main pane width. Both were
previously no-ops, causing cascading uneven splits.
Server side:
- Add workspace.equalize_splits v2 API that calls the existing
TabManager.equalizeSplits (sets all dividers to 0.5)
CLI side:
- select-layout now calls workspace.equalize_splits before tracking
main-vertical state
- resize-pane -x <columns> without directional flags now computes
the pixel delta from current to desired width and resizes accordingly
* Fix equalize to use proportional divider positions
The previous equalize set all dividers to 0.5, which in a right-
recursive binary tree (from successive splits) gives 50/25/12.5/6.25%
instead of equal sizes.
New algorithm counts leaf panes on each side of each split and sets
the divider to N_left / (N_left + N_right). For 5 panes in a chain:
1/5, 1/4, 1/3, 1/2, giving each pane exactly 20%.
* Fix select-layout main-vertical to only equalize vertical splits
The proportional equalize was treating the top-level horizontal split
(main vs agent column) the same as vertical splits, setting the main
pane to 1/6 of the window with 5 agents.
For main-vertical layout, only equalize vertical splits (the agent
column), leaving the horizontal main/agent divider untouched. The
subsequent resize-pane -x handles the main pane width.
workspace.equalize_splits now accepts an optional orientation filter
("vertical" or "horizontal") to scope which splits get equalized.
* Re-equalize agent column after kill-pane
* Address PR review comments
- Fix cmux omo --help: remove omo from the help-bypass guard so
--help shows usage text instead of trying to launch opencode
- Don't overwrite unreadable opencode.json: fail with an error
instead of silently resetting to empty config
- Drain installer pipes concurrently before waitUntilExit to
prevent deadlock from full pipe buffers during bun/npm install
---------
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
Allow naming a workspace at creation time instead of requiring a
separate rename-workspace call afterward.
Threads a title parameter through:
- CLI: --name <title> flag parsed and sent as "title" in v2 params
- V2 handler: extracts title, passes to TabManager.addWorkspace()
- TabManager: uses provided title instead of auto-generated
"Terminal N" and calls setCustomTitle() to persist it
- V1 handler: accepts optional name argument
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Fix claude-teams pane anchoring: main-vertical layout + focus
Claude's agent teams sends `split-window -h` for each teammate then
`select-layout main-vertical` to stack them vertically. Three fixes:
1. Implement select-layout main-vertical: track layout state in the
tmux compat store so subsequent horizontal splits of the leader
pane get redirected to vertical splits of the right-side column.
2. Pass focus:false to surface.split from the split-window handler
so internal bonsplit focus stays on the leader pane.
3. Fix tmuxCompatStoreURL to respect $HOME env var (was using
NSString.expandingTildeInPath which ignores $HOME).
Closes https://github.com/manaflow-ai/cmux/issues/2118
* Fix claude-teams split routing: auto-seed main-vertical on first right split
The split-window routing was broken in two ways:
1. After the first teammate split (right), the main-vertical state wasn't
being created, so all subsequent splits also went right instead of
stacking down in the right column.
2. The old code only redirected splits when main-vertical was already active
AND the target was the leader surface. Claude's teams protocol targets
arbitrary panes from list-panes, not necessarily the leader.
Now the first teammate split goes right (creating the column), auto-seeds
the main-vertical state, and all subsequent splits stack downward. The
caller's surface (CMUX_SURFACE_ID) is used as the anchor regardless of
which pane Claude targets.
Also adds caller surface preference in pane target resolution so the
caller's exact surface is used when the target pane matches, preventing
stale selected-surface references after tab switches.
---------
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
* Add set-color/clear-color workspace actions for tab color via CLI
Expose the existing tab color functionality through the workspace-action
CLI command, enabling programmatic tab color setting without the GUI
context menu.
Supports both named colors (Red, Blue, Amber, etc.) and hex values
(#RRGGBB). Named colors resolve against the built-in palette via
case-insensitive matching.
Usage:
cmux workspace-action --action set-color --color blue
cmux workspace-action --action set-color --color "#C0392B"
cmux workspace-action set-color Amber
cmux workspace-action clear-color
* Return explicit null color in clear_color JSON response
Restore "color": null in the clear_color response payload so JSON
consumers can distinguish "color was cleared" from "no color field".
---------
Co-authored-by: Ariel Tobiana <arieltobiana@gmail.com>
* Add Codex CLI hooks integration
Adds `cmux codex install-hooks` to install lifecycle hooks into
~/.codex/hooks.json and enable the codex_hooks feature flag. The hooks
call `cmux codex-hook <event>` which gracefully no-ops (exit 0, prints
{}) when not running inside cmux, so they're safe to leave installed
globally.
Supported events: SessionStart (session tracking), UserPromptSubmit
(set Running status), Stop (completion notification + Idle status).
Install merges with existing user hooks and is idempotent. Uninstall
(`cmux codex uninstall-hooks`) removes only cmux-owned hooks,
identified by the `cmux codex-hook` command prefix.
* Show diff and ask for confirmation before modifying user config
install-hooks and uninstall-hooks now preview changes to hooks.json and
config.toml before applying, with a [Y/n] prompt. Pass --yes/-y to
skip confirmation.
Hook commands use `command -v cmux` guard so they silently no-op
(echo '{}') when cmux CLI is not on PATH (e.g. user runs codex in a
non-cmux terminal or after uninstalling cmux).
* Improve diff output with line numbers and context
install-hooks and uninstall-hooks now show unified-diff-style output
with line numbers and surrounding context lines, making it easier to
see exactly what will change in hooks.json and config.toml.
* Check CMUX_SURFACE_ID in shell guard before calling cmux
The hook shell command now checks [ -n "$CMUX_SURFACE_ID" ] first,
so it short-circuits to echo '{}' without ever invoking cmux when
not inside a cmux terminal. Prevents usage text and socket errors
from leaking into Codex hook output.
* Uninstall reverts config.toml; fix [features] section handling
uninstall-hooks now also removes codex_hooks from config.toml and
shows the diff for both files before asking for confirmation.
buildConfigWithCodexHooks uses exact TOML key matching instead of
substring contains, and inserts after the first [features] header
only (not replacingOccurrences which hit all matches).
---------
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
Add tty field to surface items in system.tree JSON response,
reading from existing surfaceTTYNames dictionary. Also show
tty= in the CLI text tree output for terminals that have a
registered TTY.
This enables external tools (e.g. CodeV) to cross-reference
claude process TTYs with cmux surfaces for accurate session
detection when multiple sessions share the same working directory.
- Swift app: feedback API endpoint, docs URLs, changelog URL, CLI help
- PostHog proxy: r.cmux.dev -> r.cmux.com
- All 20 README files: docs and blog links
- Homebrew cask: homepage URL in update-homebrew workflow
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
* Fix stale Claude status in sidebar by adding missing hooks and OSC suppression
The Claude Code integration only used 3 hooks (SessionStart, Stop, Notification),
leaving gaps that caused stale sidebar status. Now uses 6 hooks:
- SessionEnd: clears status when Claude exits (covers Ctrl+C where Stop doesn't fire)
- UserPromptSubmit: clears "Needs input" and sets "Running" on new prompt
- PreToolUse (async): clears "Needs input" when Claude resumes after permission grant
Also:
- Suppress OSC 9/99 desktop notifications for workspaces with active Claude hook
sessions to prevent duplicates from the raw OSC path
- Store Claude process PID in status entries for stale-session detection
- Add 30-second sweep timer that checks agent PIDs and clears stale entries
(safety net for SIGKILL/crash where no hook fires)
- Update wrapper test expectations for the new hook set
Fixes https://github.com/manaflow-ai/cmux/issues/1301
* Don't show "Running" status on Claude launch, only when actually working
SessionStart now registers the PID for tracking and OSC suppression via
set_agent_pid without setting a visible status entry. "Running" only
appears when the user submits a prompt (UserPromptSubmit) or Claude
starts using tools (PreToolUse).
Added set_agent_pid / clear_agent_pid socket commands to decouple PID
tracking from visible status entries. OSC suppression checks agentPIDs
instead of statusEntries so it works during the initial idle period.
* Don't restore status entries across app restarts
Status entries are ephemeral runtime state tied to running processes
(e.g. claude_code "Running"). Restoring them after restart shows stale
status for processes that no longer exist.
* Address PR review comments and remove debug logging
- session-end: only clear status/PID/notifications when Stop didn't fire first
- PID sweep: check errno == ESRCH instead of treating all kill(pid,0) failures as dead
- Validate CMUX_CLAUDE_PID > 0
- Propagate tracked PID in pre-tool-use setClaudeStatus
- OSC suppression: use tabManagerFor(tabId:) for multi-window support
- clearAgentPID: resolve tab UUID before async dispatch
- restoreSessionSnapshot: also clear agentPIDs alongside statusEntries
- Fix AskUserQuestion surfaceId overwrite (wrong workspace notification)
- Fix notification text matching for "Claude Code needs your attention"
- AskUserQuestion: render option labels as bracketed inline text
- Remove artificial text truncation limits
- Remove temporary JSONL debug logging from all handlers
* Use resolveTabIdForSidebarMutation in clearAgentPID
* Fallback stable socket listener to user socket path
* Move stable socket path out of /tmp
* Keep socket health checks active on fallback paths
---------
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
* Adapt welcome screen colors for light mode
Detect macOS appearance and use a darker cyan-to-purple gradient
with sufficient contrast (WCAG AA 4.5:1+) on light backgrounds.
Replace dim ANSI attribute with explicit true-color for light mode,
since dim can reduce contrast further against light backgrounds.
* Keep original gradient colors, only adapt tagline and dim text
The cyan-to-purple gradient looks good in both modes. Only the
tagline gray and dim description text need darker values for
light backgrounds.