Commit graph

251 commits

Author SHA1 Message Date
austinpower1258
1918264ae0 Add "Open Folder in VS Code (Inline)" via menu and command palette
Adds a File menu item and command palette entry to pick a local folder
and open it in an inline VS Code browser panel. Extracts the inline
VS Code open logic from ContentView into a reusable AppDelegate method
so both the right-click context action and the new open-panel flow
share the same code path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 22:27:36 -07:00
Lawrence Chen
8979c8cabe
Let ctrl-k reach command palette text editing 2026-03-30 18:41:04 -07:00
Austin Wang
867c93e4fa
Keep cmux browser Find shortcuts authoritative (#2356)
* Route browser Find shortcuts through web content first

* Keep cmux browser Find shortcuts authoritative

* Add browser Find inspector regression test

* Fix browser Find routing follow-ups
2026-03-30 03:16:10 -07:00
Austin Wang
29c0f525db
Add New Window to Dock menu (#2340)
* Add Dock menu new-window regression test

* Add New Window to Dock menu
2026-03-30 02:19:17 -07:00
Austin Wang
63dd7281f5
Fix fullscreen new windows opening in current Space (#2345)
* Fix fullscreen new windows opening in current Space

* works

* Stabilize fullscreen tiling regression test
2026-03-30 01:43:41 -07:00
Austin Wang
f1be3978ab
Fix stale session geometry crash after 0.63.0 upgrade (#2306)
* Add regression coverage for stale window geometry migration

* Discard stale persisted window geometry on launch
2026-03-28 13:52:48 -07:00
Lawrence Chen
e9afc22353
Skip quit confirmation for tagged DEV builds (#2288)
* Skip quit confirmation for tagged DEV builds

Tagged DEV builds are ephemeral dev iterations, so the "Quit cmux?"
dialog just adds friction. Check SocketControlSettings.launchTag() in
both applicationShouldTerminate and handleQuitShortcutWarning to bypass
the confirmation when a tag is present.

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

* Use bundle ID instead of env var for tagged DEV detection

CMUX_TAG env var is only set when reload.sh --launch opens the app.
When the user cmd-clicks the app path, it launches via Finder without
the env var, so launchTag() returns nil and the quit dialog still shows.

Switch to checking the bundle identifier (com.cmuxterm.app.debug.<tag>)
which is baked into the built app and available regardless of how it was
launched. Add SocketControlSettings.isTaggedDevBuild() helper.

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-28 03:57:25 -07:00
Mikhail Andreev
cfe6cf89d8
fix: keyboard shortcuts not working with Russian layout (#2202)
* fix: keyboard shortcuts not working with Russian and other non-Latin layouts

When a non-Latin input source (Russian, etc.) is active, event characters
are non-ASCII. The ANSI keyCode fallback was blocked when the layout-based
translation resolved a character, leaving no safety net. Now the keyCode
fallback is always available for non-Latin layouts, matching the physical
key position — similar to Ghostty's `physical:` keybinding behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add unit tests for Russian keyboard layout shortcut matching

Two tests for Cmd+T with non-Latin (Russian) keyboard layout:
1. Layout provider returns "t" (normal ASCII fallback) — verifies
   the layout-based matching path works with Cyrillic event chars.
2. Layout provider returns nil (translation failure) — verifies the
   ANSI keyCode fallback catches the shortcut by physical key position.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: scope ANSI keyCode fallback to non-ASCII events, add Russian to comments

Address review feedback:
- Split !hasUsableEventChars into two precise conditions:
  (hasEventChars && !eventCharsAreASCII) for non-Latin layouts, and
  (!hasEventChars && layoutCharacter empty) for synthetic/empty-char events.
  This prevents unintended keyCode fallback on Dvorak/Colemak with empty
  synthetic events.
- Add "Russian" to the non-Latin layout list in the guard comment at line 10626.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:25:36 -07:00
Achieve
6a41c9f42f
fix(quit): enforce Warn Before Quit when Cmd+Q arrives via app switcher (#2186)
applicationShouldTerminate was returning .terminateNow unconditionally,
bypassing QuitWarningSettings. Now it shows the same confirmation alert
used by handleQuitShortcutWarning, with an isQuitWarningConfirmed flag
to prevent a double dialog when the Cmd+Q shortcut path already confirmed.

Fixes #2139

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 15:12:32 -07:00
Lawrence Chen
9969c5e6a1
Fix NSTextView focus-stealer fallback 2026-03-25 17:40:46 -07:00
Lawrence Chen
8a3ab6b3f0
Fix command palette focus after terminal find (#2089)
* test: cover command palette focus guard

* fix: block terminal find from stealing palette focus

* test: cover text view focus-stealer fallback

* Add regression for hidden DevTools sync republish loop

* Avoid redundant DevTools visibility publishes

* test: cover browser find focus after workspace round-trip

* fix: restore browser find focus after workspace round-trip

* fix: keep browser find caret on workspace return

* Add workspace round-trip split find regressions

* Keep inactive find overlays from stealing focus

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-25 17:27:54 -07:00
Austin Wang
0ea16b12c2
Fix window position restore on relaunch (#2129)
* test: cover accessible window frame restore

* fix: preserve accessible window frame on relaunch
2026-03-25 02:05:13 -07:00
Lawrence Chen
0d8597caf9
New window inherits size from current window (#2124)
* New window inherits size from current window

When creating a new window via Cmd+Shift+N, use the key window's
frame dimensions instead of the hardcoded 460x360 default. The new
window cascades from the existing window's position so it doesn't
stack directly on top.

* Use Ghostty's cascade algorithm for new window positioning

Match upstream Ghostty's window cascade logic: maintain a
lastCascadePoint that tracks where the next window should appear.
First window seeds the point from its own top-left corner, subsequent
windows advance the cascade point via NSWindow.cascadeTopLeft(from:).
On window close, reset the cascade point to the closing window's
position so the next window appears nearby.

New windows still inherit the key window's size so Cmd+Shift+N
creates a window matching the previous one's dimensions.

* Fix frame-to-contentRect conversion and use preferred window resolver

Convert existingFrame to a content rect via
NSWindow.contentRect(forFrameRect:styleMask:) so the new window
matches the source window's actual size instead of growing by
titlebar insets on each Cmd+Shift+N.

Use preferredMainWindowContextForWorkspaceCreation to resolve the
source window, consistent with showOpenFolderPanel and other
callers.

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-25 01:26:06 -07:00
Austin Wang
ffb660dee8
Fix first click on detected update pill (#2117) 2026-03-25 00:51:34 -07:00
Achieve
5b82041160
Handle Cmd+O in handleCustomShortcut to prevent Documents folder open (#2034)
* Handle Cmd+O in handleCustomShortcut to prevent Documents folder open

Cmd+O for "Open Folder" was only handled in SwiftUI menu, which can
fail due to focus bugs when terminal is focused. This caused AppKit's
default NSDocumentController to open the Documents folder instead.
Now Cmd+O is intercepted in handleCustomShortcut like other shortcuts.

Fixes #2010

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix fallback directory loss and deduplicate Open Folder logic

Address review feedback:
1. Pass selected directory URL to fallback window creation so the
   user's folder choice is not silently discarded
2. Replace inline NSOpenPanel code in cmuxApp.swift menu action
   with a call to AppDelegate.showOpenFolderPanel() to avoid
   future divergence between the two code paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Set NSOpenPanel directoryURL to current terminal working directory

Address review feedback: set panel.directoryURL to the focused
terminal's working directory so Open Folder starts in a contextually
relevant location instead of AppKit's default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Use shared main-window resolver and openWorkspaceForExternalDirectory in showOpenFolderPanel

Address review feedback: use preferredMainWindowContextForWorkspaceCreation
for directory seeding (works when auxiliary windows are key) and
openWorkspaceForExternalDirectory for workspace creation (ensures
shouldBringToFront and consistent fallback behavior).

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-25 00:26:30 -07:00
Austin Wang
321f8c14c8
fix(browser): keep IME Enter on composition path (#2108)
* test: cover browser IME Enter composition routing

* fix(browser): keep IME Enter on composition path
2026-03-24 22:56:55 -07:00
Pratik Pakhale
b9c656b90c
feat: cmux.json for custom commands (#2011)
* Pre-launch app for browser UI test on headless CI runners

XCUIApplication.launch() blocks ~60s then fails on headless WarpBuild
runners because foreground activation requires a GUI login session.

Apply the same pre-launch strategy used for the display resolution test:
- CI shell launches the app with env vars before running xcodebuild
- Test detects pre-launched app via manifest, uses activate() instead of
  launch() to avoid killing and relaunching the app
- Falls back to clicking the window for focus via accessibility framework

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

* Revert "Pre-launch app for browser UI test on headless CI runners"

This reverts commit a540e2fd99aaa1395b91a8d50caa797cdd7551b8.

* feat: cmux.json for custom commands

* tests: add cmux  json tests

* fix: pr review feedback: validation, translations, input handling, and palette improvements

  - Fix Danish ("Overfladedef inition") and Norwegian ("rotmapp") translation typos
  - Add empty-string check for baseCwd fallback in command palette handlers
  - Coalesce \r\n into single Return keypress in sendInput
  - Redact command text from timeout log to prevent secret leakage
  - Add decode-time validation: reject hybrid/empty commands, ambiguous layout
    nodes, wrong split children count, and empty pane surfaces
  - Namespace custom command IDs with "cmux.config.command." prefix
  - Forward command description to palette subtitle when available
  - Update tests for new validation rules and ID prefix

* fix: address PR review feedback — per-window config isolation, blank validation, ancestor walk,
  palette sanitization

* fix: fallback to current dir cmux.json watching if no any cmux.json found in full acesor walk

* ci: trigger CI for fork PR

* Add directory trust for cmux.json command confirmation

The confirm dialog now shows the actual command text and has an "Always
trust commands from this folder" checkbox. When checked, future confirm
commands from that directory skip the dialog.

Trust is scoped to the git repo root if the cmux.json is inside a repo,
so trusting once covers all subdirectories. Non-git directories are
trusted by exact path. Global config is always trusted.

Trusted directories are persisted in ~/Library/Application Support/cmux/
trusted-directories.json.

* Add trusted directories section to Settings

Shows all trusted directories with per-directory revoke buttons and a
Clear All option. Placed in a "Custom Commands" section between
Automation and Browser in Settings.

* Replace trusted directories list with editable textarea

One path per line, with a Save button that activates on changes.
Users can add, remove, or edit paths directly.

* Auto-save trusted directories on edit, remove Save button

Matches the behavior of other textarea settings (browser host
whitelist, external URL patterns) which auto-save via @AppStorage.

* Sanitize command text in confirm dialog against BiDi attacks

Strip zero-width and BiDi override characters from the command preview
so the dialog shows exactly what will be executed.

---------

Co-authored-by: austinpower1258 <austinwang115@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-24 22:28:46 -07:00
Achieve
03355ca3fc
Consume Cmd+number shortcuts even when workspace index is out of bounds (#2033)
When pressing Cmd+N for a workspace number that doesn't exist,
the event was not consumed and fell through to Ghostty's goto_tab
binding, which could create a new window. Now the event is always
consumed when the digit matches, preventing unintended window creation.

Fixes #1970

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:26:31 -07:00
Matthew Z.
a0ae085531
Fix workspace creation failing after long uptime (#1930)
When MainWindowContext.window (weak var) becomes nil after extended
uptime, resolvedWindow(for:) falls back to windowForMainWindowId()
which searches NSApp.windows by identifier. However, the recovered
window was only assigned back to context.window without reindexing
the mainWindowContexts dictionary — leaving the ObjectIdentifier key
stale. Subsequent lookups via contextForMainTerminalWindow() would
miss the context, causing addWorkspaceInPreferredMainWindow() to
return nil and Cmd+N to fall back to opening a new window.

Call reindexMainWindowContextIfNeeded() when re-resolving a window
so the dictionary key matches the current NSWindow object.

Fixes #1929

Co-authored-by: CHE-3 <schumannzheng@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:54:48 -07:00
austinpower1258
94c656fbbd Force windows visible on headless CI runners for UI test rendering
Two fixes:
1. Use FileManager.temporaryDirectory for diagnostics path instead of
   hardcoded /tmp/ — Process-spawned app inherits the test runner's
   sandbox and can't write to /tmp/.
2. Add orderFrontRegardless() after activate() in the UI test window
   creation path — on headless CI runners, activate() silently fails
   and windows stay invisible, preventing terminal rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 03:53:19 -07:00
austinpower1258
fc858fcfa4 Revert UI test foreground activation changes back to 56a4d258
Reverts cbb21872, 54ec524a, 10fd323b, 75375ab7, 82a16aa7 — all
attempts to fix display resolution UI test foreground activation
on CI that introduced regressions. Restores the state from the
last fully green CI run (56a4d258).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 02:38:06 -07:00
Austin Wang
cbb2187260
Fix UI test foreground activation on CI (#1981) 2026-03-23 01:42:03 -07:00
Lawrence Chen
5be9edaf5e
Merge pull request #1957 from che-3/fix/esc-not-working-in-panels
Fix Escape key not working in terminal panels (e.g. lazygit)
2026-03-22 17:49:00 -07:00
Lawrence Chen
4c92271137
Merge pull request #1913 from centraldogma99/fix/korean-input-keyboard-shortcuts
Fix keyboard shortcuts not working with Korean input mode
2026-03-22 17:18:47 -07:00
CHE-3
5de59cd4ed fix: stop consuming repeated Escape keys after command palette dismissal
The `shouldConsumeSuppressedEscape` function had an early return that
unconditionally consumed all repeated Escape key events (`isARepeat`),
regardless of whether the suppression window had expired. This caused
Escape presses to be swallowed in TUI apps (e.g. lazygit) running in
panels, because the repeat events never reached the active responder.

Removing the `isARepeat` guard lets repeated Escapes fall through to
the existing time-based check (0.35s window), which correctly expires
and stops consuming events after the command palette is dismissed.

Fixes #1610

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 19:42:24 -04: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
최준영
8cd9cd96c1 Fix keyboard shortcuts not working with Korean (한글) input mode
When a non-Latin input source like Korean 두벌식 is active,
event.charactersIgnoringModifiers returns Hangul characters (e.g. ㅅ
for T key) instead of Latin letters. This caused all character-based
shortcut matching to fail — Cmd+T, Cmd+D, Cmd+1-9, Ctrl+N/P, etc.

Root cause: KeyboardLayout.character(forKeyCode:modifierFlags:) assumed
CJK input sources lack kTISPropertyUnicodeKeyLayoutData, but Korean
두벌식 has it. UCKeyTranslate returned Korean characters and the ASCII
fallback was never reached.

Fix:
- KeyboardLayout.character(): check result is ASCII before accepting;
  fall through to TISCopyCurrentASCIICapableKeyboardInputSource() when
  the current source returns non-ASCII characters
- Add KeyboardLayout.normalizedCharacters(for:) helper that normalizes
  event.charactersIgnoringModifiers for shortcut comparison
- Apply normalization in handleCustomShortcut (AppDelegate),
  BrowserPanelView omnibar key handler, and BrowserPopupWindowController
  Cmd+W handler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 21:16:10 +09:00
Lawrence Chen
a592ed126a
Add failing regression test for browser find focus (#1891)
* test: add browser find focus regression

* ci: run browser find focus regression on prs

* ci: merge pr ui regressions into one job

* fix: focus browser find after navigation

* test: rename ui regressions workflow guard

* Fix browser find focus after address bar navigation

* Fix test-e2e workflow manifest script

* Address PR review feedback

* Stabilize browser focus regression on CI

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-20 22:12:26 -07:00
Lawrence Chen
4376e6e19a
Support image drag-and-drop into SSH terminals (#1838)
* Add remote image drag-and-drop uploads

* test: cover ssh image paste planning

* fix: upload images pasted into ssh terminals

* fix: share zsh history in cmux ssh relay shells

* fix: add cancellable ssh image transfer indicator

* fix: harden async ssh image transfer callbacks

* fix: address ssh image upload review feedback

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-20 18:31:19 -07:00
Lawrence Chen
886de2a7c9
Add IntelliJ IDEA to command palette Open Directory targets (#1860)
Co-authored-by: jjonyo <jonyo.park@gmail.com>
2026-03-20 02:57:17 -07:00
이수민
8b49d66763
fix: support keyboard shortcuts with CJK input sources (Korean, Chinese, Japanese) (#1649)
When a non-Latin input source is active, event.charactersIgnoringModifiers
returns CJK characters that cannot match Latin shortcut keys. This adds
ASCII-capable input source fallback in KeyboardLayout and updates the
matchShortcut guard to skip early-return when event chars are non-ASCII.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 02:47:19 -07:00
Lawrence Chen
1e908b2b75
Merge origin/main into feat-hidden-titlebar-minimalism-reset 2026-03-18 04:05:43 -07:00
Lawrence Chen
798c1fbc42
Fix laggy terminal sync during sidebar drags (#1598)
* Fix sidebar drag terminal resize lag

* Add display resolution churn regression

* Prelaunch display churn helper in e2e workflow

* Use manifest handoff for display churn UI test

* Fix e2e display churn harness startup

* Resolve display churn UI test socket path

* Use marker-based socket discovery in display UI test

* Add failing sidebar drag portal regression tests

* Fix sidebar drag terminal portal resize lag

* Add failing scoped resize regression tests

* Fix terminal portal resize scheduling lag

* Add failing zsh resize prompt regression test

* Fix zsh resize prompt duplication

* Fix Sequoia sidebar resize regression

* Guard display-resolution CI runner

* Run display-resolution CI on WarpBuild

* Allow backgrounded display regression app launch

* Launch display regression app directly

* Launch display regression app via NSWorkspace

* Load display regression launch env from manifest

* Write display regression manifest in runner temp dir

* Write display regression manifest in shared tmp

* Write display regression manifest in repo scratch dir

* Launch display regression app with explicit env

* Avoid xcodebuild broken pipe in compat CI

* Launch display regression via XCUIApplication

* Harden display regression socket readiness

* Trust display socket diagnostics path

* Replace display socket probe with render diagnostics

* Write display churn start marker atomically

* Move display churn harness out of /tmp

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-18 01:28:11 -07:00
Lawrence Chen
e505782a31
Merge remote-tracking branch 'origin/main' into feat-hidden-titlebar-minimalism-reset 2026-03-17 20:06:43 -07:00
ddotz
6cca8c9264
Fix dark mode icon not applied in automatic mode (#1510)
ensureApplicationIcon() was explicitly loading and setting the light icon
via NSImage(named: NSImage.applicationIconName) even in automatic mode,
overriding the asset catalog's appearance-based icon selection.

Delegate to AppIconSettings.applyIcon() which correctly sets
applicationIconImage = nil for automatic mode, allowing macOS 15+ to
select the dark variant from the asset catalog automatically.

Fixes #1509
Related: #688
2026-03-17 17:50:13 -07:00
Lawrence Chen
90e573b68f
Merge origin/main into feat-hidden-titlebar-minimalism-reset 2026-03-17 17:37:28 -07:00
Lawrence Chen
a22bfa9709 Fix command palette open target availability 2026-03-17 17:15:33 -07:00
Lawrence Chen
bb6dacf20d Add regression coverage for app lookup open targets 2026-03-17 17:15:33 -07:00
Lawrence Chen
f5d610e3ea
Merge remote-tracking branch 'origin/main' into task-browser-import-followups
# Conflicts:
#	Sources/Workspace.swift
2026-03-17 16:49:16 -07:00
Lawrence Chen
b9de0f0446
Add browser import hint debug variants 2026-03-17 03:01:50 -07:00
Lawrence Chen
f97716939a
Add browser import UI test launch hook 2026-03-17 02:29:39 -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
Lawrence Chen
746fb8e5ec
Merge pull request #318 from manaflow-ai/issue-122-import-browser-cookies-history-settings
Browser: import data from detected installed browsers
2026-03-16 22:42:40 -07:00
Lawrence Chen
92cb42262c
feat: add browser profile mapping import flow 2026-03-16 21:22:39 -07:00
Austin Wang
1480171e5e
Support folder drops on dock icon (#1571) 2026-03-16 21:00:30 -07:00
Austin Wang
971b2b4e77
fix: show sidebar update banner from background checks (#1543) 2026-03-16 20:40:35 -07:00
Lawrence Chen
5da7da127a
Narrow shortcut settings notifications 2026-03-15 22:09:37 -07:00
Austin Wang
bd1788639d
Fix terminal find overlay crash and focus handoff (#1487)
* Add regression tests for terminal find overlay races

* Fix terminal find overlay crash and focus handoff
2026-03-15 18:32:24 -07:00
Lawrence Chen
d67237b891
Fix hidden titlebar underlap and settings focus 2026-03-15 18:03:38 -07:00