Commit graph

210 commits

Author SHA1 Message Date
Lawrence Chen
9bb2816e05
Fix main CI regressions (#1458)
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-15 02:04:33 -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
98f5553335
Fix macOS dictation NSTextInputClient conformance (#1410)
* Add dictation text input regression tests

* Fix dictation text input client conformance

* Fix dictation caret rect anchoring

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-13 18:14:02 -07:00
Lawrence Chen
cd04bb8932
Merge origin/main into feat-cmux-themes-command 2026-03-13 17:22:12 -07:00
Austin Wang
3891a787f6
Merge pull request #1403 from manaflow-ai/cmux/cwd-regression
Fix split cwd inheritance while shell cwd is stale
2026-03-13 17:09:54 -07:00
austinpower1258
4bb212510e fix(cmux): preserve split cwd while shell cwd is stale 2026-03-13 17:02:48 -07:00
Lawrence Chen
7bd199b625
Address cmux themes PR feedback 2026-03-13 15:48:49 -07:00
Lawrence Chen
cfa7b1d1a6
test: cover close-tab shell state regression 2026-03-13 15:43:03 -07:00
Lawrence Chen
5f074f810e
Fix session restore replay for transient terminal states 2026-03-13 07:20:18 -07:00
Lawrence Chen
09ea29a63a fix: restrict rtfd attachment fallback to images 2026-03-13 05:30:38 -07:00
Lawrence Chen
4a3b9e7c9b fix: support attachment-only rtfd image paste fallback 2026-03-13 05:30:38 -07:00
Lawrence Chen
adcd0be0f7 fix: support direct image clipboard UTIs 2026-03-13 05:26:54 -07:00
Lawrence Chen
e94daa0bcf
Fix terminal Cmd+V clipboard payload handling (#1305)
* Add clipboard payload regression tests

* Fix terminal clipboard payload handling
2026-03-13 04:46:13 -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
e9556ba5f4 Prevent background terminal focus retries from reordering windows 2026-03-12 02:20:10 -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
379150a6c1 Move terminal drop overlay outside hosted view 2026-03-11 18:30:14 -07:00
austinpower1258
c7bbb72e09 Add terminal drop overlay container regression test 2026-03-11 18:26:25 -07:00
Lawrence Chen
e6a293bd78 Merge remote-tracking branch 'origin/main' into issue-151-ssh-remote-port-proxying 2026-03-11 18:21:39 -07:00
austinpower1258
90ca63690a Defer terminal resize while drop hover is active 2026-03-11 18:18:55 -07:00
austinpower1258
67f81e64f0 Add drag hover terminal resize regression test 2026-03-11 18:16:31 -07:00
Lawrence Chen
6849b83f8d
Reduce typing lag from sidebar re-evaluation and hitTest overhead (#1204)
* Add typing hot path timing diagnostics

* Add stress workspace debug menu item

* Restore stress workspace preload debug path

* Reduce typing lag from sidebar re-evaluation and hitTest overhead

hitTest: gate divider/sidebar/drag routing to pointer events only,
avoiding two full view-tree walks per non-pointer event.

forceRefresh: replace per-keystroke ISO8601DateFormatter + FileHandle
I/O with dlog() in DEBUG builds.

TabItemView: replace @EnvironmentObject subscriptions with plain refs
and precomputed parameters, add Equatable conformance to skip body
re-evaluation when parent rebuilds with unchanged values. @self changed
re-evaluations dropped from 668 to 1 during rapid typing.

* Add typing-latency guardrail comments and CLAUDE.md pitfalls

Strategic comments on hitTest, TabItemView, and forceRefresh to prevent
future regressions. Adds typing-latency-sensitive paths to CLAUDE.md
pitfalls section so agents know the constraints before editing.

* Add workspace palette actions and fix release autosave typing guard

Add Move Up/Down/Top, Close Other/Above/Below, Mark Read/Unread to
Cmd+Shift+P command palette and a Workspace submenu in the menu bar.

Fix recordTypingActivity() being gated behind #if DEBUG, which prevented
release builds from honoring the typing quiet period in autosave.
2026-03-11 17:54:02 -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
ec10dfdaec
Add browser find focus debug logs (#1162)
* Add browser find focus debug logs

* Allow browser find bar focus in portal host

* Add split and terminal find debug logs

* Avoid stealing search focus across splits

* Generalize panel focus restore intent

* Unify split focus intent activation

* Address focus restore review feedback

* Yield inactive panel focus before restore

* Gate browser find focus retries by generation

* Avoid repeated browser focus invalidation

* Keep browser find ownership while find bar is open
2026-03-10 19:31:52 -07:00
austinpower1258
df9a6ba0df Add split-zoom portal visibility regression coverage 2026-03-10 13:08:35 -07:00
austinpower1258
d089f6df18 fix: restore split terminal resize after Cmd-D 2026-03-10 02:01:57 -07:00
austinpower1258
07412f39fd fix: recover split terminal focus on pointer down 2026-03-10 00:30:12 -07:00
Lawrence Chen
dea60ea71c
Update ghostty to v1.3.0 (#1142)
* Update ghostty to v1.3.0

* Add bell handling and AppleScript support

* Add zsh shell integration handoff test

* Fix Ghostty zsh integration handoff in cmux

* Add terminal keypress notification dismissal test

* Dismiss terminal notifications on keypress

* Address PR review feedback

* Tighten notification dismissal regression test

* Pin GhosttyKit checksum for latest ghostty
2026-03-09 21:32:54 -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
2f4c81a96a Merge origin/main into issue-846-vim-indicator 2026-03-09 18:15:50 -07:00
Lawrence Chen
10f85ef8c7
Merge pull request #1017 from atani/fix/cjk-font-fallback
fix: add CJK font fallback to prevent decorative font rendering
2026-03-09 18:10:12 -07:00
Austin Wang
b824147dcb
Fix notification ring dismissal on direct terminal clicks (#1126)
* Add regression test for terminal notification click dismissal

* Dismiss terminal notifications on direct clicks

* Add regression for focused terminal notification ring

* Keep focused terminal notifications unread until click

* Verify direct notification dismiss triggers flash

* Use focus-flash path for direct notification dismiss

* Align notification dismiss flash with ring geometry
2026-03-09 17:55:07 -07:00
Austin Wang
c447bee602
Fix browser pane portal anchor sizing (#1094)
* Fix browser pane webview sizing

* Guard browser portal by pane ownership

* Keep browser portal frame during transient zero geometry

* Guard portal surfaces against duplicate hosts

* Defer terminal surface reflow during tab drags

* Fix browser panel pane ID unit tests
2026-03-09 13:28:05 -07:00
Brian Le
39f95db739
fix(terminal): tighten vim badge updates 2026-03-09 01:56:01 -04:00
Brian Le
d2c58c7707
fix(terminal): cap vim badge width 2026-03-09 01:44:02 -04:00
Brian Le
c3a8c2317f
fix(terminal): address vim badge review notes 2026-03-09 00:53:42 -04:00
Brian Le
ad8c57432c
fix(terminal): keep vim badge overlay passthrough 2026-03-09 00:39:14 -04:00
Brian Le
c62878ed61
fix(terminal): polish vim badge indicator 2026-03-09 00:33:19 -04:00
Brian Le
65bb81079b
feat(terminal): show vim key table badge 2026-03-09 00:07:00 -04:00
atani
cee109bab0 docs: clarify CJK font fallback comment with environment-dependent behavior
The fallback issue is caused by CTFontCollection scoring prioritizing
monospace fonts, not just CTFontCreateForString. The selected decorative
font varies by environment (e.g. AB_appare from Adobe CC, or LingWai).
2026-03-08 23:03:38 +09:00
austinpower1258
e4d8002116 Rebind terminal portal when host entry goes missing 2026-03-07 11:36:58 -08:00
austinpower1258
9e8a401e3c Fix tooltip tracking lifetime and shortcut lag 2026-03-07 01:46:02 -08:00
austinpower1258
d43d7d6a51 Fix drag hover redraw churn in hosted panes 2026-03-06 15:47:11 -08:00
atani
7236ba8d8a fix: strip trailing '?' before removing quotes in include path parsing
Reorder the trimming so that the optional include marker '?' is removed
before surrounding quotes are stripped. This prevents quoted paths like
"foo"? from being misparsed as foo".
2026-03-07 01:19:44 +09:00
atani
23202990df fix: scan app-support config paths for existing font-codepoint-map
Include ~/Library/Application Support/<bundle-id>/config(.ghostty)
paths in the codepoint-map detection scan. This ensures that
font-codepoint-map entries in the release app-support config (loaded
by loadReleaseAppSupportGhosttyConfigIfNeeded for debug builds) are
detected before injecting CJK font fallback defaults.
2026-03-07 01:08:51 +09:00
atani
a0ba82f8be fix: harden config-file include scanning
- Add cycle detection via visited path set to prevent infinite recursion
  on cyclic config-file includes.
- Resolve relative include paths against the parent directory of the
  including config file.
- Strip trailing '?' from optional include paths (Ghostty convention).
- Use UUID-based path for missing file test.
- Add tests for relative includes, optional includes, and cyclic includes.
2026-03-06 23:28:59 +09:00