Commit graph

152 commits

Author SHA1 Message Date
Austin Wang
3952c2588b
Fix workspace creation crash after restore (#1985)
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-25 00:04:03 -07:00
Ariel Tobiana
7cbd07e8cb
Add set-color/clear-color workspace actions for tab color via CLI (#1873)
* 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>
2026-03-24 23:58:54 -07:00
I LUK KIM
533699f98c
feat: add arrow keys, shift+tab, home/end/delete/pageup/pagedown to sendNamedKey (#1920)
The socket API's send-key command only supported enter, escape, tab,
backspace, and ctrl+letter. Arrow keys and shift+tab had to be sent
as raw escape sequences via send_text, but 0x1B is filtered out by
socketTextChunks and converted to a standalone Escape key event,
breaking multi-byte sequences like \x1b[A (ArrowUp).

This commit extends sendNamedKey to handle:
- Arrow keys: up/down/left/right (with arrow_up/arrowup aliases)
- shift+tab / shift-tab / backtab
- home, end
- delete / del / forward_delete
- pageup / page_up
- pagedown / page_down

These map directly to the existing sendKeyEvent infrastructure using
the appropriate kVK_* keycodes and modifier flags.

Co-authored-by: I Luk Kim <yirugi@gmail.com>
2026-03-24 23:58:51 -07:00
Joshua Swanson
f436d46668
fix(browser): use native value setter for React compatibility (#2059)
* fix(browser): use native value setter for React/Vue/Angular compatibility

fill, type, and select commands set input values via direct property
assignment (el.value = x), which does not trigger state updates in
frameworks that override the value setter on element instances.

Use Object.getOwnPropertyDescriptor on the prototype to call the
native setter, which bypasses the framework override and allows the
subsequent input/change events to propagate correctly through
React's synthetic event system.

Affects: browser.fill, browser.type, browser.select

* walk prototype chain instead of instanceof for cross-realm and web component support

---------

Co-authored-by: joshuaswanson <joshuaswanson@users.noreply.github.com>
2026-03-24 20:47:27 -07:00
Grimmer Kang
2a2374afcf
feat: expose per-surface TTY in tree output (#2040)
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.
2026-03-24 20:27:23 -07:00
Austin Wang
33dcc606bf
Customizable number shortcuts (#1951)
* Allow customizing numbered workspace and surface shortcuts

* Update bonsplit submodule to squashed main commit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 14:54:54 -07:00
austinpower1258
b10cddcb9b Protect pinned workspaces from close actions 2026-03-20 19:38:24 -07:00
BillionToken
8782978aba
fix(hooks): handle TabManager unavailable in SessionEnd/Start hooks (#1735)
Fixes #1715

The resolveTabForReport() function had an early guard that returned nil
when self.tabManager was nil, even when a valid --tab argument was
provided. This prevented Claude hook commands from resolving tabs via
AppDelegate.shared when the local tabManager wasn't available.

Changes:
- Modified resolveTabForReport() to allow tab resolution via --tab param
  even when self.tabManager is nil
- Removed early guard in upsertSidebarMetadata() that blocked resolution

Co-authored-by: BillionClaw <267901332+BillionClaw@users.noreply.github.com>
2026-03-20 02:14:29 -07:00
Zachary Salzbank
730d64b943
feat: add --direction flag to markdown open command (#1763)
Supports left/right/up/down, defaulting to right (existing behavior).
Matches the --direction flag convention used by new-pane and new-split.
2026-03-20 01:48:28 -07:00
bagelcode-jhkim
e0c301b277
feat: add set-color/clear-color to workspace-action CLI (#1833)
* [auto] cmux session changes (1 files) [03/19 17:38]

* feat: add set-color/clear-color to workspace-action

- CLI: parse --color option in runWorkspaceAction
- CLI: validate --color required for set-color action
- CLI: pass color param to v2 payload
- CLI: update help text and usage summary
- TerminalController: add set_color/clear_color to supportedActions
- TerminalController: handle set_color/clear_color cases via setTabColor

* fix: resolve named colors via palette, improve clear_color response

* fix: validate hex input via normalizedHex, fix synopsis typo
2026-03-19 22:34:31 -07:00
Lawrence Chen
b301218405
Honor explicit notification surface targets 2026-03-19 01:21:18 -07:00
Austin Wang
55cb5c6763
Fix sidebar workspace PR status display and false positives (#1636)
* test(sidebar): add failing PR checks regressions

* fix(sidebar): show workspace PR status

* refactor(sidebar): restore PR icon style

* refactor(sidebar): simplify PR check labels

* test(sidebar): cover focused workspace PR selection

* fix(sidebar): scope workspace PRs to current branch

* test(sidebar): cover stale PR after branch change

* fix(sidebar): clear stale PRs on branch changes

* test(sidebar): cover workspace PR false positives

* fix(sidebar): stop false-positive workspace PR badges

* test(cmuxTests): remove duplicate sidebar PR regressions
2026-03-17 22:57:12 -07:00
Lawrence Chen
8d8fadbb27
Add hidden CLI command for live terminal debugging (#1599)
* Add hidden terminal debug CLI command

* Expand orphan terminal debug metadata

* Remove stray CLIProcessRunner test target wiring

* Tighten debug terminal diagnostics handling

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-17 04:03:49 -07:00
Lawrence Chen
832426af56
Stabilize SSH remote flow after merging main 2026-03-16 23:57:48 -07:00
Lawrence Chen
03dc055138
Merge remote-tracking branch 'origin/main' into pr-ssh-stack-main
# Conflicts:
#	CLI/cmux.swift
#	Sources/Panels/BrowserPanel.swift
#	Sources/TabManager.swift
#	Sources/Workspace.swift
#	cmuxTests/GhosttyConfigTests.swift
2026-03-16 23:16:12 -07:00
Austin Wang
9bf6ad9457
Avoid blocking browser PR metadata updates (#1564) 2026-03-16 22:10:15 -07:00
Lawrence Chen
3fbfd74aa1 Fix socket focus and startup env regressions 2026-03-13 21:55:48 -07:00
Lawrence Chen
623262493b
Fix stale Claude sidebar status: add missing hooks, OSC suppression, PID sweep (#1306)
* 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
2026-03-13 20:47:42 -07:00
Lawrence Chen
2a8d4475a3
Throttle repeated socket listener start failures 2026-03-13 19:54:09 -07:00
Lawrence Chen
2eae782739 Merge remote-tracking branch 'origin/main' into pr-ssh-stack-main
# Conflicts:
#	.github/workflows/ci.yml
#	CLI/cmux.swift
#	Sources/GhosttyTerminalView.swift
#	Sources/SocketControlSettings.swift
#	Sources/TabManager.swift
#	Sources/TerminalController.swift
#	Sources/Workspace.swift
#	ghostty
#	scripts/reload.sh
2026-03-13 17:56:38 -07:00
Lawrence Chen
8a0934b801
Fallback stable socket listener to a user-scoped path (#1351)
* 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>
2026-03-13 17:37:01 -07:00
Lawrence Chen
5dd93a8ab1
Merge pull request #1401 from manaflow-ai/task-cmd-shift-u-exits-cmd-shift-enter-mode
Exit split zoom when jumping to unread
2026-03-13 17:28:34 -07:00
Lawrence Chen
cd04bb8932
Merge origin/main into feat-cmux-themes-command 2026-03-13 17:22:12 -07:00
Lawrence Chen
09a98c911d
Guard notification focus failures 2026-03-13 17:21:40 -07:00
Lawrence Chen
a99ee15672
fix: honor shell state for close confirmation 2026-03-13 15:43:04 -07:00
Lawrence Chen
965965c879 Merge origin/main into pr-ssh-stack-main 2026-03-13 06:25:08 -07:00
Lawrence Chen
50b5969d62 Add remote favicon proxy regression 2026-03-13 06:15:23 -07:00
Lawrence Chen
4fffe3be3d Address ssh stack review follow-ups 2026-03-13 04:28:24 -07:00
Lawrence Chen
601e5a92e4 Merge origin/main into pr-ssh-stack-main 2026-03-13 04:18:07 -07:00
Lawrence Chen
6584a01aef
Add cmux themes command 2026-03-13 03:26:51 -07:00
Ariel Tobiana
1d6f55ce97
Include current_directory and custom_color in list-workspaces output (#544)
Expose workspace working directory and tab color in the workspace.list
response, enabling CLI-based workspace sorting and color inspection.
2026-03-12 23:40:38 -07:00
Lawrence Chen
19b59cae37 Reapply "Merge pull request #239 from manaflow-ai/issue-151-ssh-remote-port-proxying"
This reverts commit f7cbbad434.
2026-03-12 15:54:26 -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
8a9e28e129 Secure remote daemon distribution and relay auth 2026-03-12 05:04:44 -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
austinpower1258
5233874425 ok 2026-03-11 18:32:23 -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
d9021861e3 Preserve ssh remote browser proxy flow 2026-03-11 15:45:20 -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
Austin Wang
d25067f38f
Merge pull request #1170 from manaflow-ai/fix-1160-devtools-loop
Fix side-docked browser DevTools resizing
2026-03-10 20:12:17 -07:00
austinpower1258
eea6cdc1bd works 2026-03-10 19:18:30 -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
Gonzalo Serrano
3a3a2da6db Add color field to sidebar_state output
Expose workspace customColor in sidebar_state so external
tools can read it without a new API endpoint.
2026-03-09 15:01:02 +01:00
austinpower1258
01e9a05817 Merge remote-tracking branch 'origin/main' into issue-1036-tooltip-tracking-area-crash
# Conflicts:
#	Sources/ContentView.swift
2026-03-07 02:53:20 -08:00
austinpower1258
9e8a401e3c Fix tooltip tracking lifetime and shortcut lag 2026-03-07 01:46:02 -08: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