You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(terminal): preserve macOS Korean composition - #12280
Preserve macOS 2-Set Korean composition in xterm terminals.
Return initial Hangul jamo keydowns to the native IME instead of letting xterm consume and preventDefault them before composition starts.
Scope the bypass to recognized Korean input sources and unmodified jamo keys, leaving shortcuts and other input sources unchanged.
Add native macOS exact-byte coverage for physical 2-Set input.
Native reproduction before the fix: physical gksrmf reached the PTY as ㅎㅏㄴ글.
After the fix: the same physical keys reach the PTY as 한글 (ed959ceab8800a).
Screenshots
No visual change.
Testing
pnpm lint
pnpm typecheck
pnpm test
pnpm build
Added or updated high-quality tests that would catch regressions, or explained why tests were not needed
Ran:
Native macOS 2-Set Korean headful E2E before and after the fix; reproduced the wrong exact PTY bytes, then passed with 한글.
210 focused terminal IME tests across 9 files.
Node and web TypeScript checks.
Oxlint and React Doctor checks on all changed files.
Oxfmt and git diff --check.
The native E2E setup rebuilt the Electron app and bundled CLI successfully.
AI Review Report
Reviewed the event boundary from macOS keydown through xterm composition and PTY bytes. The main risk was over-bypassing normal terminal keys or existing CJK/Vietnamese handling. The implementation gates jamo handling on a recognized Korean input source, rejects Ctrl/Alt/Meta chords, and leaves active compositions with xterm's existing composition helper.
Cross-platform compatibility was explicitly checked. Production behavior changes only on macOS when a Korean input source is active. Linux/IBus, Windows IME, SSH/folder-workspace routing, shortcut labels, paths, and shell behavior are unchanged. The macOS-only native test is platform- and environment-gated.
Security Audit
No production command execution, dependency, IPC, authentication, secret, or path-handling changes. Input handling is constrained to single Hangul jamo code points and unmodified key events. The native test invokes fixed AppleScript commands through execFileSync; its only interpolation is the numeric Electron process ID, and it runs only behind an explicit macOS test gate.
Notes
The native regression requires macOS Accessibility access and Apple 2-Set Korean selected, then runs with ORCA_E2E_NATIVE_MACOS_KOREAN=1.
The change adds forwardHangulJamo to macOS native text-input feature detection. Korean input sources enable the feature, while other sources keep it disabled. Native text handling now recognizes and forwards Hangul Jamo keys when enabled. Unit tests cover source detection and modifier behavior. A conditional macOS headful end-to-end test verifies native 2-Set Korean input, PTY bytes, and terminal boundary events.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
preventDefaultthem before composition starts.Native reproduction before the fix: physical
gksrmfreached the PTY asㅎㅏㄴ글.After the fix: the same physical keys reach the PTY as
한글(ed959ceab8800a).Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildRan:
한글.git diff --check.AI Review Report
Reviewed the event boundary from macOS keydown through xterm composition and PTY bytes. The main risk was over-bypassing normal terminal keys or existing CJK/Vietnamese handling. The implementation gates jamo handling on a recognized Korean input source, rejects Ctrl/Alt/Meta chords, and leaves active compositions with xterm's existing composition helper.
Cross-platform compatibility was explicitly checked. Production behavior changes only on macOS when a Korean input source is active. Linux/IBus, Windows IME, SSH/folder-workspace routing, shortcut labels, paths, and shell behavior are unchanged. The macOS-only native test is platform- and environment-gated.
Security Audit
No production command execution, dependency, IPC, authentication, secret, or path-handling changes. Input handling is constrained to single Hangul jamo code points and unmodified key events. The native test invokes fixed AppleScript commands through
execFileSync; its only interpolation is the numeric Electron process ID, and it runs only behind an explicit macOS test gate.Notes
The native regression requires macOS Accessibility access and Apple 2-Set Korean selected, then runs with
ORCA_E2E_NATIVE_MACOS_KOREAN=1.