Commit graph

95 commits

Author SHA1 Message Date
Lawrence Chen
1309152bfc
Respect system theme in cmux picker 2026-03-13 04:52:23 -07:00
Lawrence Chen
7d178ad5c7
Fix interactive cmux themes launch 2026-03-13 04:32:52 -07:00
Lawrence Chen
ae24dad89f
Use Ghostty theme picker for cmux themes 2026-03-13 04:24:19 -07:00
Lawrence Chen
6584a01aef
Add cmux themes command 2026-03-13 03:26:51 -07:00
Lawrence Chen
f7cbbad434 Revert "Merge pull request #239 from manaflow-ai/issue-151-ssh-remote-port-proxying"
This reverts commit 78e4bd32ba, reversing
changes made to cf75da8f8a.
2026-03-12 14:45:58 -07:00
Lawrence Chen
b12f70b26c Merge origin/main into issue-151-ssh-remote-port-proxying 2026-03-12 05:09:03 -07:00
Lawrence Chen
8a9e28e129 Secure remote daemon distribution and relay auth 2026-03-12 05:04:44 -07:00
Lawrence Chen
64b37fc121
Add Cmd+T (New tab) to welcome screen shortcuts (#1258) 2026-03-12 03:19:35 -07:00
tiffanysun1
85f9ad6ee9 Polish version guard follow-ups 2026-03-12 02:35:23 -07:00
tiffanysun1
f41a831778 Stop version lookup at root 2026-03-12 02:26:52 -07:00
Lawrence Chen
de47345538 Address ssh review feedback and CI blockers 2026-03-11 23:03:53 -07:00
Lawrence Chen
1b4f396a48 Merge remote-tracking branch 'origin/main' into issue-151-ssh-remote-port-proxying
# Conflicts:
#	Sources/Panels/BrowserPanel.swift
2026-03-11 22:52:47 -07:00
Lawrence Chen
f71c2c144b
Adapt welcome screen colors for light mode (#1214)
* 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.
2026-03-11 18:38:34 -07:00
Lawrence Chen
d67090994e Merge branch 'main' into issue-151-ssh-remote-port-proxying 2026-03-11 15:56:47 -07:00
Lawrence Chen
00587ed856
Add cmux claude-teams launcher (#1179)
* Add claude-teams CLI command

* Add claude-teams launcher regression test

* Exec claude-teams launcher in place

* Add existing-shim claude-teams regression test

* Reuse claude-teams shim and refresh dev CLI

* Add wrapper-selection claude-teams regression test

* Launch real claude binary for claude-teams

* Add claude-teams auto-mode launcher regression test

* Default claude-teams to fake tmux auto mode

* Build tagged reloads under DerivedData

* Add claude-teams tmux sequence regression test

* Fix claude-teams tmux teammate compatibility

* Add claude-teams split focus regression test

* Keep claude-teams leader pane focused

* Tighten claude-teams review fixes

* Pass claude-teams help through to Claude

* Use sentinel TERM_PROGRAM in claude-teams test
2026-03-11 02:42:33 -07:00
Lawrence Chen
52783bddf0
Polish welcome, feedback, and shortcuts flows (#1169)
* Add cmux welcome command with ASCII logo and shortcuts

Adds `cmux welcome` CLI command that prints a blue-to-purple gradient
chevron logo, version info, and key shortcuts. Auto-runs once on first
workspace creation via UserDefaults. Adds "Welcome" to the ? help menu
in the sidebar footer, which opens a new workspace running the command.

* Polish welcome, feedback, and shortcuts flows
2026-03-10 20:59:34 -07:00
Lawrence Chen
13b7300de8 Keep remote cmux wrapper on ssh shells 2026-03-10 00:38:02 -07:00
Lawrence Chen
e5445f4071 Fix cmux ssh startup isolation 2026-03-10 00:18:27 -07:00
Lawrence Chen
bdebc8ecc9 Merge branch 'main' into issue-151-ssh-remote-port-proxying
# Conflicts:
#	CLI/cmux.swift
#	Sources/ContentView.swift
#	Sources/GhosttyTerminalView.swift
#	Sources/Panels/BrowserPanel.swift
#	Sources/Panels/BrowserPanelView.swift
#	Sources/TabManager.swift
#	Sources/TerminalController.swift
#	Sources/Workspace.swift
#	Sources/WorkspaceContentView.swift
#	ghostty
2026-03-09 18:36:59 -07:00
Lawrence Chen
30bb74dc92 Merge branch 'pr-374-ssh-remote-cli-relay' into issue-151-ssh-remote-port-proxying
# Conflicts:
#	CLI/cmux.swift
#	Sources/ContentView.swift
#	Sources/GhosttyTerminalView.swift
#	Sources/Panels/TerminalPanel.swift
#	Sources/SocketControlSettings.swift
#	Sources/TabManager.swift
#	Sources/TerminalController.swift
#	Sources/Workspace.swift
#	daemon/remote/README.md
#	daemon/remote/cmd/cmuxd-remote/main.go
#	docs/remote-daemon-spec.md
#	tests_v2/test_ssh_remote_cli_metadata.py
2026-03-09 18:31:10 -07:00
Austin Wang
4ba967556e
Fix cmux --version memory blowup (#1121)
* Add version memory guard regression test

* Fix cmux --version plist lookup blowup
2026-03-09 16:35:05 -07:00
Lawrence Chen
e7c3961489
Revert "Add workspace pages in the titlebar (#1030)" (#1040)
This reverts commit 4de975e6a4.
2026-03-07 00:05:58 -08:00
Lawrence Chen
4de975e6a4
Add workspace pages in the titlebar (#1030)
* Add workspace pages in the titlebar

* Add workspace pages UI test target entry

* Relax workspace pages UI test titlebar checks

* Use page close button in workspace pages UI test

* Stabilize workspace pages UI test interruptions

* Skip page close confirms in UI tests

* Clean up superseded workspace handoffs

* Tighten page hint UI assertions

---------

Co-authored-by: cmux <cmux@cmuxs-Mac-mini.local>
2026-03-06 21:23:11 -08:00
Lawrence Chen
43f42b730c
Merge pull request #972 from manaflow-ai/task-browser-open-trailing-json-flags
Support trailing browser output flags
2026-03-05 22:39:14 -08:00
Lawrence Chen
ff428a7386
Merge pull request #973 from manaflow-ai/task-browser-goto-snapshot-after-parsing
Fix browser goto snapshot-after parsing
2026-03-05 22:39:10 -08:00
Lawrence Chen
0e7daae4a6 Merge remote-tracking branch 'origin/main' into task-browser-open-trailing-json-flags
# Conflicts:
#	CLI/cmux.swift
2026-03-05 20:03:19 -08:00
Lawrence Chen
085e192bca
Add diagnostics for empty browser snapshots (#977) 2026-03-05 20:01:05 -08:00
Lawrence Chen
d99fa96c09
Fix browser screenshot to return image URL (#936)
* Return browser screenshot image URL

* Make screenshot path/url best effort

* cli: omit screenshot png_base64 from json output

* browser wait: fail fast on js errors and include screenshot in help

* browser wait: avoid main-actor default world warning

* tests: scope contentWorld regression check to function signature

* browser screenshot: clean up output handling and tests

* browser wait: resolve snapshot refs in selector waits
2026-03-05 19:09:29 -08:00
Lawrence Chen
61792c3caf Fix browser goto snapshot-after parsing 2026-03-05 17:57:05 -08:00
Lawrence Chen
103f80fac2 Support trailing browser output flags 2026-03-05 17:56:37 -08:00
Lawrence Chen
0a490b0e03
Fix Claude wrapper hook errors when cmux socket is stale (#868)
* Fix Claude wrapper hook injection when cmux socket is stale

* Harden socket listener lifecycle and rearm policy

* Unset CLAUDECODE in stale-socket passthrough

* Harden listener cleanup and bound claude ping probe

* Guard socket unlink during listener startup window
2026-03-04 18:52:57 -08:00
Austin Wang
76835662f5
Fix CLI socket autodiscovery for tagged cmux sockets (#832) 2026-03-04 18:03:25 -08:00
Ismail Pelaseyed
d72b014d6d
feat: add markdown viewer panel with live file watching (#883)
* Add markdown viewer panel with live file watching

Introduce a new PanelType.markdown that renders .md files in a dedicated
panel using MarkdownUI (SwiftUI), with live file watching via DispatchSource
so content auto-updates when the file changes on disk.

- New MarkdownPanel class with file system watcher (write/delete/rename/extend)
- New MarkdownPanelView with custom cmux theme (headings, code blocks, tables,
  blockquotes, inline code, lists, horizontal rules, light/dark mode)
- Full workspace integration: SurfaceKind, creation methods, tab subscription
- Session persistence: snapshot/restore across app restarts
- V2 socket command: markdown.open (validates path, resolves workspace, splits)
- CLI command: cmux markdown open <path> with routing flags and help text
- Agent skill: skills/cmux-markdown/ with SKILL.md, openai.yaml, and references
- Cross-link from skills/cmux/SKILL.md to the new markdown skill
- SPM dependency: gonzalezreal/swift-markdown-ui 2.4.1

* Fix unreachable guard in markdown subcommand dispatch

Use looksLikePath() to distinguish subcommands from path arguments
so the guard can catch unknown subcommands and future subcommands
are parsed correctly.

* Use .isoLatin1 fallback instead of .ascii for encoding recovery

ASCII is a strict subset of UTF-8, so falling back to .ascii after
UTF-8 fails is dead code. Use .isoLatin1 which accepts all 256 byte
values and covers legacy encodings like Windows-1252.

* Mark fileWatchSource as nonisolated(unsafe) for deinit safety

deinit is not guaranteed to run on the main actor, so accessing
@MainActor-isolated storage is a data race under strict concurrency.
DispatchSource.cancel() is thread-safe, so nonisolated(unsafe) is
sufficient with a documented invariant that writes only occur on main.

* Fix file watcher reattach: retry loop with cancellation guard

- Replace one-shot 500ms retry with up to 6 attempts (3s total window)
  so files that reappear after a slow atomic replace are picked up
- Add isClosed flag checked before each retry to prevent restarting
  the watcher after close()/deinit

* Harden path validation in markdown.open command

Reject directories and non-absolute paths before panel creation
to prevent ambiguous behavior and generic downstream failures.

* Always reattach file watcher on delete/rename events

After an atomic save (delete old + create new), the DispatchSource still
points to the old inode. Previously we only reattached when the file was
unreadable, so successful atomic saves left the watcher on a stale inode
and live updates silently stopped. Now we always stop and reattach:
immediately if the new file is readable, via retry loop if not.

* Restore markdown panels even when file is missing at launch

MarkdownPanel already handles unavailable files gracefully (shows
'file unavailable' UI and retries via the reattach loop). Dropping
the panel on restore lost the user's layout for files that may
reappear shortly after (network drives, build artifacts, etc.).

* Harden markdown CLI parsing and startup reconnect behavior

---------

Co-authored-by: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com>
2026-03-04 17:48:28 -08:00
Lawrence Chen
bfe843f0bd
Clear sidebar notification when user submits prompt (#821)
* Clear sidebar notification when user submits prompt in Claude Code

Add UserPromptSubmit hook to the Claude Code wrapper that calls
`cmux claude-hook prompt-submit`. This clears the workspace notification
and sets status back to "Running" when the user addresses Claude's question,
so the "waiting for input" preview in the sidebar goes away.

Also adds --tab support to clear_notifications socket command and
--workspace support to the clear-notifications CLI command for
per-workspace notification clearing.

Closes https://github.com/manaflow-ai/cmux/issues/799

* Address review feedback: stricter error handling

- clear-notifications CLI: error on explicit --workspace failure instead of
  falling back to global clear. Env var still gracefully degrades.
- prompt-submit hook: propagate sendV1Command errors instead of swallowing
  with try?.
- clear_notifications socket: validate --tab flag is present before resolving,
  reject malformed args instead of falling back to selected tab.

* Gate env workspace fallback on windowId == nil in clear-notifications

Matches the pattern used by other CLI commands to avoid using
CMUX_WORKSPACE_ID from the caller shell when --window targets
a different window.
2026-03-03 18:48:32 -08:00
Lawrence Chen
fdc38a3326
Add external URL bypass rules for embedded browser opens (#768)
* Add external URL bypass rules for embedded browser opens

* Align open-wrapper external regex handling with app-side matcher
2026-03-02 17:50:34 -08:00
Lawrence Chen
f451766d12
Add cmux <path> to open directories and Homebrew binary stanza (#705)
* Add `cmux <path>` to open directories and Homebrew binary stanza

CLI: `cmux .` or `cmux /path/to/dir` opens a new workspace at the
given directory. If the app isn't running, it launches first and waits
for the socket. Also adds `--cwd` flag to `new-workspace`.

Server: `workspace.create` now accepts an optional `cwd` parameter,
passed through to `TabManager.addWorkspace(workingDirectory:)`.

Homebrew: adds `binary` stanza to the cask so `cmux` CLI is globally
available after `brew install --cask cmux`. Updated both the cask file,
the CI workflow template, and the manual release script so automated
version bumps preserve the stanza.

* Address review: validate cwd type, fix socket detection, propagate errors

- looksLikePath now also matches paths containing `/` (e.g. `foo/bar`)
- openPath uses socket connection attempt instead of fileExists to detect
  whether the app is running (Unix sockets may not appear on filesystem)
- launchApp/activateApp now throw instead of swallowing errors with try?
- Server validates that cwd param is a string, returns invalid_params error
  if wrong type is passed
2026-02-28 20:25:41 -08:00
Lawrence Chen
fff1cd786f Fix ssh workspace focus and harden remote daemon bootstrap paths 2026-02-28 19:56:11 -08:00
Lawrence Chen
bfe36f817d Address remaining PR #239 review findings 2026-02-28 19:14:46 -08:00
Lawrence Chen
47f4b5e55a Address PR review feedback for SSH remote workspace flow 2026-02-28 17:36:07 -08:00
Lawrence Chen
c179ee74ea Merge origin/main into issue-151-ssh-remote-port-proxying 2026-02-28 17:17:30 -08:00
Lawrence Chen
6800cd44bb WIP: advance ssh remote workspace proxying 2026-02-28 17:05:55 -08:00
Lawrence Chen
181574586e
Fix --help flag executing commands instead of showing help (#657)
* Fix --help flag executing commands instead of showing help (#650)

The --help check fell through to command dispatch when subcommandUsage
returned nil for a command. Now --help always returns before dispatch,
printing a generic fallback when no specific help text exists.

Also adds missing subcommandUsage entries for: new-window, list-panes,
list-pane-surfaces, surface-health, trigger-flash, list-panels,
focus-panel, set-app-focus, ping, capabilities, identify, list-windows,
current-window, refresh-surfaces, current-workspace, list-notifications,
clear-notifications.

Closes #650

* Document all flags and options in CLI --help output

Every subcommand's help text now shows all accepted flags, options,
environment variable fallbacks, and positional arguments matching the
actual dispatch code. Also adds help entries for commands that were
returning the generic fallback (list-workspaces, list-panes,
list-pane-surfaces, surface-health, trigger-flash, list-panels,
focus-panel, set-app-focus, etc.)

* Show 'Unknown command' for invalid commands, add legacy alias help

Unknown commands now show "Unknown command 'X'. Run 'cmux help' to see
available commands." instead of the misleading "No detailed help
available." Also adds help entries for legacy browser aliases
(open-browser, navigate, etc.) pointing to 'cmux browser --help'.

* Audit all 89 CLI commands for complete help coverage

- Add missing `help` subcommandUsage entry
- Expand id|ref → id|ref|index for move-workspace-to-window,
  close-workspace, select-workspace, rename-workspace
- Document CMUX_WORKSPACE_ID/CMUX_TAB_ID/CMUX_SURFACE_ID env var
  defaults in tab-action, rename-workspace
- Expand browser help: get (--selector, --attr, --property),
  find (--name, --exact, --index), network route (--abort, --body),
  open/open-split/new env var defaults
- Remove duplicate rename-window help case (now handled by
  rename-workspace combined case)
- Upgrade regression test to auto-extract dispatch+subcommandUsage
  switches and flag any commands missing help entries
2026-02-27 17:38:33 -08:00
Lawrence Chen
9ae737026d
Fix browser eval: await promises, always-on console hooks, undefined detection (#613)
- Wrap eval scripts in async IIFE that detects and awaits thenables,
  using callAsyncJavaScript when available (macOS 11+) (#603)
- Register console/error telemetry hooks as WKUserScript at document
  start so they survive navigation and are active before page JS (#604)
- Return typed envelope {__cmux_t, __cmux_v} from eval to distinguish
  undefined from no return value; CLI prints "undefined" (#605)
- Keep dialog hooks as lazy injection only (not document-start) to
  avoid suppressing WKUIDelegate native dialogs
- Add regression tests for async wrapper and undefined CLI rendering
2026-02-27 01:42:27 -08:00
Lawrence Chen
fdca658c80
Remove not_supported commands and legacy aliases from --help (#595)
Hide browser subcommands that always return not_supported on WKWebView
(viewport, geolocation, offline, trace, network, screencast, input)
and the legacy browser alias notice from the help output. Command
handlers remain for backwards compatibility.

Closes https://github.com/manaflow-ai/cmux/issues/593
2026-02-26 20:36:21 -08:00
Lawrence Chen
e74012a728
Add cmux tree command for full hierarchy view (#592)
Adds `cmux tree` that prints the window > workspace > pane > surface
hierarchy with box-drawing characters. Includes server-side system.tree
RPC for single-round-trip performance.

Features:
- --all flag for all windows (default: current window only)
- --workspace flag to filter to a single workspace
- --json for structured JSON output
- Active path markers (◀ active) and caller identification (◀ here)
- Browser surfaces show their current URL

Closes https://github.com/manaflow-ai/cmux/issues/586
2026-02-26 20:04:09 -08:00
Lawrence Chen
bcb6f49d6e
Fix CLI SIGPIPE exit on broken stdout pipes (#581) 2026-02-26 15:17:50 -08:00
Lawrence Chen
163f8572e4
Replace keychain password storage with file-based storage (#576)
Moves socket control password from the macOS login keychain to a
plain file at ~/Library/Application Support/cmux/socket-control-password.
This eliminates the system keychain prompt that interrupts users on
first launch or after keychain changes.

- Directory created with 0700, file written with 0600 permissions
- One-time migration copies existing keychain password to the file,
  deletes the keychain entry, and records a migration version in
  UserDefaults so it runs only once
- CLI SocketPasswordResolver also reads from the file path
- Security framework import is now conditional (#if canImport)
- Adds SocketControlPasswordStoreTests covering round-trip, env
  priority, path resolution, and migration behavior

Fixes https://github.com/manaflow-ai/cmux/issues/541
2026-02-26 14:29:12 -08:00
Lawrence Chen
2714d07c9f Scope socket password keychain per debug run and harden CLI lookup 2026-02-25 00:30:39 -08:00
Lawrence Chen
f16d8f36e7 Merge remote-tracking branch 'origin/main' into pr-374-ssh-remote-cli-relay
# Conflicts:
#	CLI/cmux.swift
#	Sources/ContentView.swift
#	Sources/TerminalController.swift
#	Sources/Workspace.swift
2026-02-25 00:14:00 -08:00
Lawrence Chen
daa340fa87 Harden cmux ssh for mixed-version remote sessions 2026-02-24 22:09:27 -08:00