Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents https://cmux.com
Find a file
Lawrence Chen 484b66c8ac
Fix terminal keys swallowed after opening browser (#45)
* Fix terminal keys (arrows, Ctrl+N/P) swallowed after opening browser

After a browser panel is shown, SwiftUI's internal focus system activates
and its _NSHostingView starts consuming arrow keys and other non-Command
key events via performKeyEquivalent, preventing them from reaching the
terminal's keyDown handler.

Fix: In the NSWindow performKeyEquivalent swizzle, when GhosttyNSView is
the first responder and the event has no Command modifier, route directly
to the terminal's performKeyEquivalent — bypassing SwiftUI's view hierarchy
walk entirely.

Also clear stale browserAddressBarFocusedPanelId when a terminal surface
has focus, preventing Cmd+N from being eaten by omnibar selection logic
after focus transitions away from a browser.

Adds DEBUG-only keyboard event ring buffer (KeyDebugLog) that dumps to
/tmp/cmux-key-debug.log for diagnosing future key routing issues.

* Fix split focus and Cmd+Shift+N swallowed after opening browser

Split focus: capture the source terminal's hostedView before bonsplit
mutates focusedPaneId, so focusPanel moves focus FROM the old pane
instead of from the new pane to itself. Also retry ensureFocus when the
new terminal's view has no window yet (matching the existing retry
pattern for isVisibleInUI).

Cmd+Shift+N: after WKWebView has been in the responder chain, SwiftUI's
internal focus system can intercept Command-key events in the content
view hierarchy (returning true) without firing the CommandGroup action
closure. Fix by dispatching Command-key events directly to NSApp.mainMenu
when the terminal is first responder, bypassing the broken SwiftUI path.
Also add Cmd+Shift+N to handleCustomShortcut so it's customizable and
doesn't depend on SwiftUI menu dispatch at all.

* Unified debug event log: merge key/mouse/focus into /tmp/cmux-debug.log

- Delete KeyDebugLog, MouseDebugLog, klog(), mlog() from AppDelegate
- Replace all klog/mlog calls with dlog() (provided by bonsplit)
- Remove debugLogCallback wiring from Workspace
- Add focus change logging: focus.panel, focus.firstResponder,
  split.created, focus.moveFocus
- Add import Bonsplit where needed for dlog access
- Fix stale drag state on cancelled tab drags (bonsplit submodule)

* Fix split focus stolen by re-entrant becomeFirstResponder during reparenting

During programmatic splits (Cmd+D / Cmd+Shift+D), SwiftUI reparents the old
terminal view, which fires becomeFirstResponder → onFocus → focusPanel for the
OLD panel, stealing focus from the newly created pane.

Add programmaticFocusTargetPanelId guard to suppress re-entrant focusPanel
calls for non-target panels during split creation.

Also document the unified debug event log in CLAUDE.md.

* Clear stale title/favicon when browser navigation fails

When a page fails to load (e.g. connection refused), the tab was still
showing the previous page's title and favicon. Now didFailProvisionalNavigation
resets pageTitle to the failed URL and clears faviconPNGData.

* Fix Cmd+N swallowed by browser omnibar and improve split focus suppression

- Only Ctrl+N/P trigger omnibar navigation, not Cmd+N/P (Cmd+N should
  always create new workspace regardless of address bar focus)
- Move split focus suppression from workspace-level guard to source:
  suppress becomeFirstResponder side-effects (onFocus + ghostty_surface_set_focus)
  directly on the old GhosttyNSView during reparenting, preventing both
  model-level and libghostty-level focus divergence
- Remove programmaticFocusTargetPanelId from Workspace.focusPanel

* Fix omnibar hang, WebView white flash, drag-over-browser, and idle CPU spin

- Omnibar: first click selects all without entering NSTextView tracking loop;
  subsequent clicks have 3s synthetic mouseUp safety net to prevent hang
- WebView: set underPageBackgroundColor to match window so new browsers don't
  flash white before content loads
- Drag/drop: register custom UTType (com.splittabbar.tabtransfer) in Info.plist
  so WKWebView doesn't intercept tab drags; override registerForDraggedTypes
  on CmuxWebView as belt-and-suspenders
- CPU: fix infinite makeFirstResponder loop in controlTextDidEndEditing by
  checking both the text field and its field editor (the actual first responder)
2026-02-17 03:21:08 -08:00
.claude/commands Release v1.23.0 (#31) 2026-02-09 15:30:43 -08:00
.github/workflows Release v1.33.0 (#41) 2026-02-16 03:30:17 -08:00
Assets.xcassets Add dev build branding and reload scripts 2026-01-28 01:20:48 -08:00
CLI Add sidebar metadata (git branch, ports, logs, progress), fix localhost URL resolution, simplify analytics 2026-02-16 02:46:39 -08:00
docs Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
docs-site Release v1.34.0 (#43) 2026-02-16 16:39:34 -08:00
ghostty@5a987a1485 Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
GhosttyTabs.xcodeproj Release v1.34.0 (#43) 2026-02-16 16:39:34 -08:00
GhosttyTabsTests add arrow nav and zoom shortcut tests, fix omnibar UI test flakiness 2026-02-15 21:49:49 -08:00
GhosttyTabsUITests Release v1.31.0 (#39) 2026-02-15 21:56:41 -08:00
homebrew-cmux@19af91f6d4 Release v1.23.0 (#31) 2026-02-09 15:30:43 -08:00
node_modules Update app and tooling 2026-01-29 17:36:26 -08:00
Resources Fix terminal keys swallowed after opening browser (#45) 2026-02-17 03:21:08 -08:00
scripts Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
skills Add sidebar metadata (git branch, ports, logs, progress), fix localhost URL resolution, simplify analytics 2026-02-16 02:46:39 -08:00
Sources Fix terminal keys swallowed after opening browser (#45) 2026-02-17 03:21:08 -08:00
tests add Claude hook session mapping test 2026-02-15 21:50:06 -08:00
tests_v2 Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
vendor Fix terminal keys swallowed after opening browser (#45) 2026-02-17 03:21:08 -08:00
web Add nightly update channel workflow and adopt AGPL licensing 2026-02-14 02:43:03 -08:00
.gitignore Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
.gitmodules Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
.vercelignore Add Vercel ignore 2026-01-29 17:50:35 -08:00
AGENTS.md agents 2026-01-22 03:18:02 -08:00
bun.lock Update app and tooling 2026-01-29 17:36:26 -08:00
CHANGELOG.md Release v1.34.0 (#43) 2026-02-16 16:39:34 -08:00
CLAUDE.md Fix terminal keys swallowed after opening browser (#45) 2026-02-17 03:21:08 -08:00
cmux-Bridging-Header.h Rename to cmux and add About panel 2026-01-26 03:05:03 -08:00
cmux.entitlements Release v1.33.0 (#41) 2026-02-16 03:30:17 -08:00
CONTRIBUTING.md Add nightly update channel workflow and adopt AGPL licensing 2026-02-14 02:43:03 -08:00
ghostty.h Initial commit: macOS terminal app with vertical tabs using libghostty 2026-01-22 01:16:24 -08:00
LICENSE Add nightly update channel workflow and adopt AGPL licensing 2026-02-14 02:43:03 -08:00
package.json Add nightly update channel workflow and adopt AGPL licensing 2026-02-14 02:43:03 -08:00
Package.resolved Initial commit: macOS terminal app with vertical tabs using libghostty 2026-01-22 01:16:24 -08:00
Package.swift Rename to cmux and add About panel 2026-01-26 03:05:03 -08:00
PROJECTS.md release: fix Sparkle upgrade path for 1.27.0 users 2026-02-14 03:26:42 -08:00
README.ar.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.bs.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.da.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.de.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.es.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.fr.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.it.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.ja.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.ko.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.no.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.pl.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.pt-BR.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.ru.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.th.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.tr.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.zh-CN.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
README.zh-TW.md update keyboard shortcuts in README and translations 2026-02-15 21:49:54 -08:00
THIRD_PARTY_LICENSES.md add third-party licenses and update bonsplit submodule 2026-02-14 20:33:40 -08:00
TODO.md Add README translations for 17 languages 2026-02-14 21:51:52 -08:00

cmux

A Ghostty-based macOS terminal with vertical tabs and notifications for AI coding agents

Download cmux for macOS

English | 简体中文 | 繁體中文 | 한국어 | Deutsch | Español | Français | Italiano | Dansk | 日本語 | Polski | Русский | Bosanski | العربية | Norsk | Português (Brasil) | ไทย | Türkçe

cmux screenshot

Features

  • Vertical tabs — Sidebar shows git branch, working directory, listening ports, and latest notification text
  • Notification rings — Panes get a blue ring and tabs light up when AI agents (Claude Code, OpenCode) need your attention
  • Notification panel — See all pending notifications in one place, jump to the most recent unread
  • Split panes — Horizontal and vertical splits
  • In-app browser — Split a browser alongside your terminal with a scriptable API ported from agent-browser
  • Scriptable — CLI and socket API to create workspaces, split panes, send keystrokes, and automate the browser
  • Native macOS app — Built with Swift and AppKit, not Electron. Fast startup, low memory.
  • Ghostty compatible — Reads your existing ~/.config/ghostty/config for themes, fonts, and colors
  • GPU-accelerated — Powered by libghostty for smooth rendering

Install

Download cmux for macOS

Open the .dmg and drag cmux to your Applications folder. cmux auto-updates via Sparkle, so you only need to download once.

Homebrew

brew tap manaflow-ai/cmux
brew install --cask cmux

To update later:

brew upgrade --cask cmux

On first launch, macOS may ask you to confirm opening an app from an identified developer. Click Open to proceed.

Why cmux?

I run a lot of Claude Code and Codex sessions in parallel. I was using Ghostty with a bunch of split panes, and relying on native macOS notifications to know when an agent needed me. But Claude Code's notification body is always just "Claude is waiting for your input" with no context, and with enough tabs open I couldn't even read the titles anymore.

I tried a few coding orchestrators but most of them were Electron/Tauri apps and the performance bugged me. I also just prefer the terminal since GUI orchestrators lock you into their workflow. So I built cmux as a native macOS app in Swift/AppKit. It uses libghostty for terminal rendering and reads your existing Ghostty config for themes, fonts, and colors.

The main additions are the sidebar and notification system. The sidebar has vertical tabs that show git branch, working directory, listening ports, and the latest notification text for each workspace. The notification system picks up terminal sequences (OSC 9/99/777) and has a CLI (cmux notify) you can wire into agent hooks for Claude Code, OpenCode, etc. When an agent is waiting, its pane gets a blue ring and the tab lights up in the sidebar, so I can tell which one needs me across splits and tabs. Cmd+Shift+U jumps to the most recent unread.

The in-app browser has a scriptable API ported from agent-browser. Agents can snapshot the accessibility tree, get element refs, click, fill forms, and evaluate JS. You can split a browser pane next to your terminal and have Claude Code interact with your dev server directly.

Everything is scriptable through the CLI and socket API — create workspaces/tabs, split panes, send keystrokes, open URLs in the browser.

Keyboard Shortcuts

Workspaces

Shortcut Action
⌘ N New workspace
⌘ 18 Jump to workspace 18
⌘ 9 Jump to last workspace
⌃ ⌘ ] Next workspace
⌃ ⌘ [ Previous workspace
⌘ ⇧ W Close workspace
⌘ B Toggle sidebar

Surfaces

Shortcut Action
⌘ T New surface
⌘ ⇧ ] Next surface
⌘ ⇧ [ Previous surface
⌃ Tab Next surface
⌃ ⇧ Tab Previous surface
⌃ 18 Jump to surface 18
⌃ 9 Jump to last surface
⌘ W Close surface

Split Panes

Shortcut Action
⌘ D Split right
⌘ ⇧ D Split down
⌥ ⌘ ← → ↑ ↓ Focus pane directionally
⌘ ⇧ H Flash focused panel

Browser

Shortcut Action
⌘ ⇧ L Open browser in split
⌘ L Focus address bar
⌘ [ Back
⌘ ] Forward
⌘ R Reload page
⌥ ⌘ I Open Developer Tools

Notifications

Shortcut Action
⌘ I Show notifications panel
⌘ ⇧ U Jump to latest unread

Find

Shortcut Action
⌘ F Find
⌘ G / ⌘ ⇧ G Find next / previous
⌘ ⇧ F Hide find bar
⌘ E Use selection for find

Terminal

Shortcut Action
⌘ K Clear scrollback
⌘ C Copy (with selection)
⌘ V Paste
⌘ + / ⌘ - Increase / decrease font size
⌘ 0 Reset font size

Window

Shortcut Action
⌘ ⇧ N New window
⌘ , Settings
⌘ ⇧ , Reload configuration
⌘ Q Quit

License

This project is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).

See LICENSE for the full text.