cmux/Sources
Lawrence Chen 463c6baabb
Fix CJK IME input (Korean, Chinese, Japanese) (#125)
* Fix CJK IME input not working (#118)

CJK (Korean, Japanese, Chinese) IME input was completely broken because
cmux never forwarded preedit/composition state to Ghostty's libghostty.

Root causes and fixes:

1. Missing preedit sync: Added syncPreedit() that calls
   ghostty_surface_preedit() to notify Ghostty about IME composition
   text. Called from setMarkedText, unmarkText, and after
   interpretKeyEvents in keyDown.

2. Wrong composing flag: The composing flag on key events now correctly
   accounts for when composition just ended (markedTextBefore was true
   but markedText is now empty), preventing spurious deletions when
   canceling composition.

3. Event interception during IME: Added early exits in
   performKeyEquivalent, the NSWindow swizzle, and the local event
   monitor (handleCustomShortcut) to avoid stealing key events while
   IME has active marked text.

4. IME popup positioning: firstRect(forCharacterRange:) now uses
   ghostty_surface_ime_point() for accurate cursor-relative positioning
   of the IME candidate window.

* Add regression tests for CJK IME composition (#118)

31 tests covering Korean, Japanese, and Chinese IME input scenarios:

- Korean jamo combining: ㅎ -> 하 -> 한 composition lifecycle
- Chinese pinyin: multi-letter marked text and candidate selection
- Japanese hiragana-to-kanji: romaji -> hiragana -> kanji conversion
- insertText correctly commits composed text and clears marked state
- unmarkText properly clears composition state (idempotent)
- performKeyEquivalent returns false during active composition for
  all key types (plain, shift, space, return, escape)
- Shortcut bypass: hasMarkedText gates the handleCustomShortcut bypass
- Multi-syllable sequences, backspace correction, and rapid transitions
- keyTextAccumulator lifecycle tests

Also adds #if DEBUG test accessors for keyTextAccumulator on
GhosttyNSView to enable unit testing the accumulator path.
2026-02-19 22:37:41 -08:00
..
Find Fix terminal keys swallowed after opening browser (#45) 2026-02-17 03:21:08 -08:00
Panels Fix split blackout race and stabilize focus handoff 2026-02-19 17:10:27 -08:00
Update Fix socket accept loop not restarted after Sparkle update relaunch 2026-02-17 22:00:47 -08:00
AppDelegate.swift Fix CJK IME input (Korean, Chinese, Japanese) (#125) 2026-02-19 22:37:41 -08:00
Backport.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
cmuxApp.swift Socket access control: process ancestry check (#58) 2026-02-18 01:09:24 -08:00
ContentView.swift Fix stale drag overlay click routing and add real-click regression test 2026-02-19 05:21:15 -08:00
GhosttyConfig.swift Add cmuxterm CLI and socket control modes 2026-01-28 21:19:48 -08:00
GhosttyTerminalView.swift Fix CJK IME input (Korean, Chinese, Japanese) (#125) 2026-02-19 22:37:41 -08:00
KeyboardShortcutSettings.swift Fix terminal keys swallowed after opening browser (#45) 2026-02-17 03:21:08 -08:00
NotificationsPage.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
PortScanner.swift Move port scanning from shell to app-side with batching (#100) 2026-02-19 01:04:47 -08:00
PostHogAnalytics.swift Add sidebar metadata (git branch, ports, logs, progress), fix localhost URL resolution, simplify analytics 2026-02-16 02:46:39 -08:00
SidebarSelectionState.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
SocketControlSettings.swift Fix migrateMode dropping allowAll to default cmuxOnly 2026-02-18 02:12:19 -08:00
TabManager.swift Fix split-close stale-frame stretch and add regression coverage 2026-02-19 04:15:50 -08:00
TerminalController.swift Fix split blackout race and stabilize focus handoff 2026-02-19 17:10:27 -08:00
TerminalNotificationStore.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
TerminalView.swift Add sidebar blur effect with withinWindow blending (#9) 2026-02-04 03:04:45 -08:00
TerminalWindowPortal.swift Fix panel resize hitbox and stale portal frame behavior (#114) 2026-02-19 18:32:57 -08:00
UITestRecorder.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
WindowAccessor.swift Polish browser suggestions, focus, and tagged reload flow 2026-02-14 21:33:28 -08:00
WindowDecorationsController.swift Refine settings/about titlebar styling and controls alignment 2026-02-14 02:11:35 -08:00
WindowDragHandleView.swift Fix frozen terminals after split churn (#12) 2026-02-13 16:45:31 -08:00
WindowToolbarController.swift move update pill to sidebar only, add Install Update menu item 2026-02-15 21:17:33 -08:00
Workspace.swift Fix split blackout race and stabilize focus handoff 2026-02-19 17:10:27 -08:00
WorkspaceContentView.swift Speed up workspace switching: reduce portal churn and enforce selected z-order 2026-02-18 22:13:40 -08:00