Commit graph

245 commits

Author SHA1 Message Date
Matthew Z.
eb248a1cdb
Fix Cmd+Shift+key combos being swallowed for unbound keys (#1959)
Use charactersIgnoringModifiers instead of characters when redispatching
Cmd-modified key events in performKeyEquivalent. Cmd-modified keys don't
produce text characters, so event.characters returns an empty string for
Cmd+Shift combos, preventing Ghostty from encoding them as kitty protocol
sequences. charactersIgnoringModifiers returns the actual key character
(e.g. "k" for Cmd+Shift+K) while modifiers are preserved in modifierFlags.

Fixes #1718

Co-authored-by: CHE-3 <schumannzheng@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 16:52:42 -07:00
Lawrence Chen
e0e0e35279
Merge pull request #1834 from lifrary/fix/replace-force-unwrapped-utf8-data-encoding
Replace force-unwrapped .data(using: .utf8)! with Data(string.utf8)
2026-03-22 15:38:40 -07:00
Lawrence Chen
01ffeb3f44
Merge pull request #1898 from manaflow-ai/feat-tmux-notification-attention-state
Improve tmux notification attention routing
2026-03-22 15:36:36 -07:00
Lawrence Chen
6ff81579d9
Merge pull request #1858 from martinezhermes/fix/background-opacity-blur-879
fix: apply background-opacity and background-blur to terminal rendering area (#879)
2026-03-21 03:16:47 -07:00
Lawrence Chen
c2065b135d
Fix SSH image transfer cleanup and IPv6 followups (#1907)
* Add SSH image transfer followup regressions

* Fix SSH image transfer ownership and IPv6 followups

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-20 22:04:52 -07:00
Lawrence Chen
656786fb71
Fix tmux notification attention routing 2026-03-20 20:20:54 -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
martinezhermes
1235daff04
fix: apply background-opacity and background-blur to terminal rendering area
Two root causes for issue #879:

1. GhosttyNSView was missing makeBackingLayer(), so AppKit provided a
   generic CALayer as the view's backing layer. libghostty expects
   (view.layer as? CAMetalLayer) != nil to set up Metal rendering on
   the existing layer. Without a CAMetalLayer backing layer, the Metal
   surface defaulted to isOpaque=true, making the terminal area fully
   opaque regardless of background-opacity config.

   Fix: override makeBackingLayer() to return a CAMetalLayer with
   isOpaque=false and bgra8Unorm pixel format (matching standalone
   Ghostty's SurfaceView behavior).

2. ghostty_set_window_background_blur(app, window) is exposed in
   ghostty.h but was never called in cmux. Without this call the
   macOS window never gets the NSVisualEffectView blur backdrop that
   background-blur requires.

   Fix: add applyWindowBlurIfNeeded() on GhosttyApp that reads
   background-blur from config via ghostty_config_get and calls
   ghostty_set_window_background_blur when the value is non-zero.
   Called from applyBackgroundToKeyWindow() and
   applyWindowBackgroundIfActive() whenever the window is made
   transparent.

Fixes #879

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-20 10:16:27 +01:00
김서현
9844913ea1
fix: skip Korean from CJK font-codepoint-map auto-injection (#1700)
* fix: skip Korean from CJK font-codepoint-map auto-injection

The automatic CJK font-codepoint-map injection (PR #1017) maps Korean
ranges to Apple SD Gothic Neo, which has a different style/weight from
the primary terminal font. This overrides Ghostty's native
CTFontCreateForString fallback, which dynamically selects a
better-matching font for Hangul.

Ghostty itself (ghostty-org/ghostty) has no hardcoded CJK font names
and relies entirely on CTFontCreateForString for fallback. For Korean,
this native fallback produces visually consistent results with the
primary font.

Remove the Korean branch from cjkFontMappings() so Ghostty's native
fallback handles Hangul rendering. Japanese and Chinese mappings are
unaffected.

* test: update CJK font mapping tests for Korean removal

- testCJKFontMappingsReturnsAppleSDGothicNeoWithHangulForKorean
  → renamed to testCJKFontMappingsReturnsNilForKoreanOnly
  → asserts nil since Korean is no longer auto-mapped

- testCJKFontMappingsMultiLanguageMapsScriptSpecificRanges
  → renamed to testCJKFontMappingsMultiLanguageSkipsKorean
  → asserts no Apple SD Gothic Neo mapping exists
  → Japanese mappings remain unchanged

---------

Co-authored-by: dante-ad-shield <danate@ad-shield.io>
2026-03-20 00:14:01 -07:00
Austin Wang
ed18e32d11
Fix terminal pane drag/drop handoff delay (#1837)
* Fix terminal pane portal handoff after drag

* Fix terminal portal handoff during split churn

* Fix terminal host handoff for same-pane rebuilds
2026-03-19 20:37:32 -07:00
SEUNGWOO LEE
8ad794f613 Replace force-unwrapped .data(using: .utf8)! with Data(string.utf8)
Four call sites used `line.data(using: .utf8)!` to convert a String to
Data for FileHandle.write(). While .utf8 encoding never fails for Swift
strings (making the force unwrap safe in practice), `Data(line.utf8)` is
the idiomatic Swift equivalent that avoids the force unwrap entirely.

Changed files:
- GhosttyTerminalView.swift (3 occurrences: init log, surface log, size log)
- WorkspaceContentView.swift (1 occurrence: panel debug log)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 09:51:16 +09:00
Lawrence Chen
7cbac356fc
Add optional single-click focus for inactive panes (#1796)
* Add failing first-click pane focus tests

* Enable optional first-click focus for inactive panes

* Address PR review follow-ups

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-19 01:01:10 -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
b64fb301c1
fix(terminal): execute Return after Korean IME commit (#1671)
* test(terminal): cover Return after Korean IME commit

* fix(terminal): execute Return after Korean IME commit

---------

Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com>
2026-03-17 22:07:45 -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
BillionToken
1fabe9f33c
fix(terminal): prevent doomscroll when reviewing scrollback (#1616)
The synchronizeScrollView() method was constantly resetting the scroll
position to match the terminal's scrollbar state, even when the user had
manually scrolled up to review scrollback. This caused the 'doomscroll'
bug where panes would fight the user's scroll position.

- Add userScrolledAwayFromBottom flag to track scroll intent
- Only auto-scroll when at bottom or when scrollbar indicates following
- Reset flag when user scrolls back to bottom
- Add 5-point threshold to tolerate minor float drift

Fixes #1577

Co-authored-by: BillionClaw <267901332+BillionClaw@users.noreply.github.com>
2026-03-17 17:52:59 -07:00
BillionToken
c0fd15cdd7
fix(terminal): prevent redundant focus events causing Powerlevel10k redraws (#1579)
Add lastFocusState tracking to TerminalSurface to avoid sending duplicate
focus events to the terminal surface. This fixes double prompt / extra redraw
issues when using zsh with Powerlevel10k and switching workspaces.

Fixes #1566

Co-authored-by: BillionClaw <267901332+BillionClaw@users.noreply.github.com>
2026-03-17 17:52:56 -07:00
Lawrence Chen
86876cf019
Merge remote-tracking branch 'origin/main' into feat-hidden-titlebar-minimalism-reset 2026-03-17 17:46:47 -07:00
Austin Wang
392e98126a
Fix Option+Delete word delete on AZERTY (#1640) 2026-03-17 17:45:30 -07:00
Lawrence Chen
90e573b68f
Merge origin/main into feat-hidden-titlebar-minimalism-reset 2026-03-17 17:37:28 -07:00
Austin Wang
a42e6663c4
Fix layout follow-up spin loop (#1633) 2026-03-17 17:17:24 -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
93bc5ea78b
Merge origin/main into pr-ssh-stack-main 2026-03-17 00:40: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
95ef1c8ca7
Keep portal sync responsive during live resize 2026-03-16 18:49:40 -07:00
Lawrence Chen
8d1d4722f6
Defer terminal portal sync past layout churn 2026-03-16 15:40:13 -07:00
Lawrence Chen
eaa0d871fa
Stop terminal focus from stealing Settings 2026-03-15 21:52:23 -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
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
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
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
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
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
965965c879 Merge origin/main into pr-ssh-stack-main 2026-03-13 06:25:08 -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
2e6856ff2f Fix ssh stack review regressions 2026-03-13 04:14:52 -07:00
Lawrence Chen
6584a01aef
Add cmux themes command 2026-03-13 03:26:51 -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