Commit graph

71 commits

Author SHA1 Message Date
Lawrence Chen
168e6b9b25
Auto-heal missing CLI listener socket (#679)
* Auto-heal missing CLI socket listener

* Add Sentry socket listener breadcrumbs and failure capture
2026-02-28 01:19:38 -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
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
Austin Wang
c51171294e
Merge pull request #590 from manaflow-ai/fix/issue-582-sidebar-branch-refresh
fix: keep sidebar git branch updates responsive after sleep/wake
2026-02-26 15:27:21 -08:00
austinpower1258
6b85265255 fix: avoid blocking git branch socket updates on main thread 2026-02-26 15:21:27 -08:00
Lawrence Chen
847ce008ed
Restore lazy keychain reads for socket password (#589)
Add a cached lazy keychain fallback to SocketControlPasswordStore so
that authentication paths in TerminalController can transparently read
a legacy keychain password without blocking on every request. The
keychain is read at most once and the result is cached behind an
NSLock. File-based and environment passwords still take priority.

Closes https://github.com/manaflow-ai/cmux/issues/579
2026-02-26 15:16:27 -08:00
Lawrence Chen
f28eb00b31 Merge remote-tracking branch 'origin/main' into feature/sidebar-pr-metadata
# Conflicts:
#	Sources/ContentView.swift
#	Sources/Workspace.swift
2026-02-24 20:49:29 -08:00
Lawrence Chen
e4f351027c fix(sidebar): normalize escaped newlines in markdown blocks 2026-02-24 20:39:52 -08:00
Lawrence Chen
513e9aa607 feat(sidebar): add markdown blocks, provider labels, and fine-grained toggles 2026-02-24 20:38:07 -08:00
Lawrence Chen
f2ecb4877b feat(sidebar): add generic metadata rows and commands 2026-02-24 20:19:38 -08:00
Austin Wang
32b17e8926
Merge pull request #451 from manaflow-ai/cmux/terminal-render-z-order
Fix terminal blanking after full-surface horizontal tab drop
2026-02-24 16:03:41 -08:00
Lawrence Chen
2877531ea2
Auto-focus omnibar when focusing blank browser surfaces (#448)
* Auto-focus omnibar when focusing blank browser surfaces

* Fix browser omnibar autofocus across pane and palette paths

* Fix Cmd+P switcher omnibar autofocus timing
2026-02-24 16:00:03 -08:00
austinpower1258
f33d65f986 Fix terminal blanking after full-surface tab drops 2026-02-24 16:00:00 -08:00
Lawrence Chen
6eeca9c5da Merge remote-tracking branch 'origin/main' into pr-317-session-persistence
# Conflicts:
#	Sources/AppDelegate.swift
#	Sources/cmuxApp.swift
2026-02-23 14:58:16 -08:00
Lawrence Chen
8d03657c94
Command palette caret uses white tint (#361)
* Set command palette caret tint to white

* Add command palette window actions and shortcut sync
2026-02-23 04:08:01 -08:00
Lawrence Chen
5d63c5f035
Add command palette (Cmd+Shift+P) (#358)
Implements a VS Code-style command palette with fuzzy search,
workspace/surface switching, rename mode, and keyboard navigation.

Closes https://github.com/manaflow-ai/cmux/issues/133
2026-02-23 03:26:36 -08:00
Vadim Kostin
2d454df50f feat(sidebar): show linked pull request metadata 2026-02-23 10:45:36 +08:00
Lawrence Chen
927b0eb2d1 Implement session persistence pass 1 with multi-window restore 2026-02-22 15:39:59 -08:00
Lawrence Chen
18550e5d1f Add expanded socket access modes with password auth
Implements https://github.com/manaflow-ai/cmux/issues/296 with new modes: off, cmuxOnly, automation, password, and allowAll.

Adds keychain-backed password storage, connection-level auth gates (v1 auth + v2 auth.login), settings UX with warning confirmation, CLI --password support, and regression tests.
2026-02-22 00:55:14 -08:00
Lawrence Chen
645c7f76ea Start workspace command process before workspace is opened 2026-02-21 05:06:29 -08:00
Lawrence Chen
9653113920 Queue workspace command input before surface attach 2026-02-21 04:57:46 -08:00
Lawrence Chen
a1e05fab84 Improve CLI workspace command responsiveness 2026-02-21 04:37:32 -08:00
Lawrence Chen
4cbdd999d8 Socket CLI: prevent focus stealing + add rename-tab and focus regressions 2026-02-21 02:21:27 -08:00
Lawrence Chen
e74f67d369 Merge remote-tracking branch 'origin/main' into issue-230-cli-unix-socket-lag
# Conflicts:
#	Sources/TerminalController.swift
2026-02-21 01:39:04 -08:00
Lawrence Chen
39b110d3b3 Move report_pwd fast path off main-thread sync 2026-02-21 01:01:56 -08:00
Lawrence Chen
167431b786 Avoid main-thread hops for explicit socket scope 2026-02-20 23:58:47 -08:00
Lawrence Chen
a2c39802d1 Merge origin/main into feat-sidebar-branch-refresh-on-close 2026-02-20 23:36:11 -08:00
Lawrence Chen
68cf29cd2d Deduplicate high-frequency socket metadata updates 2026-02-20 23:30:59 -08:00
Lawrence Chen
ede5b701bb
Fix Mark Tab as Unread no-op on focused tab (#249)
* Fix manual unread clear race on focused tab

* Add mark-as-read tab action and show ring for manual unread

* Flash then clear manual unread on tab focus
2026-02-20 23:07:52 -08:00
Lawrence Chen
60e7aeeb16 Fix stale sidebar git branch after split close 2026-02-20 21:47:06 -08:00
Lawrence Chen
d977477d5c Resolve tab actions by tab_id aliases 2026-02-20 20:13:36 -08:00
Lawrence Chen
a5360adb38 Unify tab/workspace action naming in CLI and socket 2026-02-20 20:13:36 -08:00
Lawrence Chen
10e44396df Add tab/workspace action APIs and consistent naming 2026-02-20 20:13:36 -08:00
Lawrence Chen
a5c7600458 Harden drag overlay routing and add terminal overlay regression probes 2026-02-20 19:58:58 -08:00
Lawrence Chen
9388358914 Merge remote-tracking branch 'origin/main' into fix-dragdrop-overlay 2026-02-20 19:53:45 -08:00
Lawrence Chen
cf767cf9af Fix bonsplit drag routing and pin submodule commit 2026-02-20 18:47:34 -08:00
Lawrence Chen
d9b7511b07
Implement pane.resize divider control and verify in tmux matrix test (#223) 2026-02-20 18:40:37 -08:00
Lawrence Chen
23979d8c02 Merge origin/main into fix-dragdrop-overlay 2026-02-20 18:29:36 -08:00
Lawrence Chen
6cb282bf09
tmux compat: implement issue-153 command set with matrix tests (#221)
* Add tmux rename-window workspace compatibility

Implement workspace.rename in the v2 API and wire CLI commands rename-workspace/rename-window with help text.

Add a regression test that validates API and CLI rename parity plus error handling.

Refs: https://github.com/manaflow-ai/cmux/issues/153

* Add full tmux compatibility command matrix and regression coverage
2026-02-20 18:22:26 -08:00
Lawrence Chen
7dbd7811df Fix workspace routing for surface.read_text
Addresses review feedback from https://github.com/manaflow-ai/cmux/pull/219 by resolving read-screen targets against requested workspace/surface instead of the selected workspace.
2026-02-20 16:31:48 -08:00
Lawrence Chen
146ac253af Harden file-drop routing for local tab drags 2026-02-20 16:27:12 -08:00
Lawrence Chen
b163c2bbf3 Expose production read-screen capture APIs
Implements capture-pane parity item from https://github.com/manaflow-ai/cmux/issues/153 by shipping production read-screen support from https://github.com/manaflow-ai/cmux/issues/152.
2026-02-20 16:22:33 -08:00
Lawrence Chen
a5d724cf28 Unify drag overlay routing and add regression coverage 2026-02-20 16:09:42 -08:00
Lawrence Chen
de666ff05b Fix split blackout race and stabilize focus handoff 2026-02-19 17:10:27 -08:00
Lawrence Chen
1b2688233f Animate terminal drop overlay and add stale tabtransfer click regression 2026-02-19 15:22:30 -08:00
Lawrence Chen
631f689aba Fix stale drag overlay click routing and add real-click regression test 2026-02-19 05:21:15 -08:00
Lawrence Chen
9642bb59fc
Move port scanning from shell to app-side with batching (#100)
* Move port scanning from shell to app-side with batching

Replace per-shell `ps -axo + lsof` scanning with a centralized
PortScanner singleton in the app. Each shell now sends lightweight
`report_tty` (once per session) and `ports_kick` (on preexec/precmd)
socket messages. The app coalesces kicks across all panels and runs a
single `ps -t <ttys> + lsof -p <pids>` covering every active panel.

Also fixes a macOS 26 Tahoe regression where `getsockopt(LOCAL_PEERPID)`
returns ENOTCONN on accepted sockets when the peer disconnects before
the handler thread starts. This was silently breaking ALL socket
commands sent via ncat --send-only. The fix captures the peer PID in
the accept loop immediately after accept(), and falls back to
LOCAL_PEERCRED (uid check) when the PID lookup fails.

* Fix PR review feedback: burst timing and auth comment clarity

- P2: burstDelays were accumulating (0.5+1.5+3+... = ~22.5s) instead of
  firing at absolute offsets from burst start. Now uses burstStart anchor
  so scans fire at 0.5s, 1.5s, 3s, 5s, 7.5s, 10s as intended.

- P1: Clarify LOCAL_PEERCRED fallback rationale — same security boundary
  as socket file permissions (0600), does not widen attack surface.
  Long-lived connections still get full descendant check via LOCAL_PEERPID.
2026-02-19 01:04:47 -08:00
Lawrence Chen
ed7f6301d0 Improve terminal hosting depth and workspace mount policy 2026-02-18 19:55:41 -08:00
Lawrence Chen
51a67e31fd
Socket access control: process ancestry check (#58)
* Socket access control: process ancestry check + file permissions

Redesign socket control modes from (off, notifications, full) to
(off, cmuxOnly, allowAll):

- cmuxOnly (default): uses LOCAL_PEERPID + sysctl process tree walk to
  verify the connecting process is a descendant of cmux. External
  processes (SSH, other terminals) are rejected.
- allowAll: hidden mode accessible only via CMUX_SOCKET_MODE=allowAll
  env var, skips ancestry check. Legacy "full"/"notifications" env
  values map here for backward compat.
- off: disables socket entirely.

Security hardening:
- Server: chmod 0600 on socket after bind (owner-only access)
- CLI: stat() ownership check before connect (reject fake sockets)

Removes per-command allow-list (isCommandAllowed) — once a process
passes the ancestry check, all commands are available.

Includes migration for persisted UserDefaults values and env var
aliases (cmux_only, cmux-only, allow_all, allow-all).

* Add /sync-branch skill for submodule + main sync
2026-02-18 01:09:24 -08:00
Lawrence Chen
d8b39aeaa4 Merge remote-tracking branch 'origin/main' into fix-file-drop-targeting 2026-02-17 22:12:26 -08:00