Repository navigation
Conversation
…he PTY Korean typed on an iPadOS hardware keyboard reached the terminal as uncomposed compatibility jamo in the web client: `한글깨짐` arrived as `ㅎㅏㄴㄱㅡㄹㄲㅐㅈㅣㅁ`. Both Safari and Chrome reproduce it, since iOS bars third-party engines and both run system WebKit. iPadOS composes Hangul with a hardware keyboard by rewriting text it has already committed — `deleteContentBackward` then `insertText` with the updated syllable — and fires no composition events at all. xterm consumed the printable keydown and default-prevented it, so that logic never ran and the raw jamo from `event.key` went to the PTY. The terminal capture contains its own control group: `ㄲ`, typed with Shift, matched the existing Shift bypass in xterm-bypass-policy.ts and produced the full native keypress/beforeinput/input chain, while every unmodified jamo produced keydown and keyup alone. Generalize that bypass to unmodified non-ASCII printable keys on iOS/iPadOS — keypress included, or _keyPress re-sends the glyph — and mirror the resulting field edits to the PTY as DEL x n + replacement. The diff is taken against the field rather than the edit events, so a stray delete cannot desync the PTY and a replacement longer than what it replaced still works: typing ㅣ after 깾 emits one deletion and reinserts two characters. Detection needs both signals. Every iOS user agent contains `Mac` (`Macintosh` in iPad desktop mode, the default since iPadOS 13, and `like Mac OS X` in mobile mode), and desktop mode omits `iPad`, so the touch-point count is the only thing separating an iPad from a Mac. No other platform changes: shouldBypassXtermForIosTextEdit returns early when the flag is off. The macOS native-text forwarder stays installed — deleting it is what regressed full-width CJK punctuation in stablyai#13128 and forced the revert in stablyai#13282. Tests replay the 19-step field sequence recorded on iPad Pro 12.9" (6th gen) / iPadOS 26.5.2 and assert the PTY renders `한글깨짐` with no compatibility jamo left over.
…external writes Follow-up to the iPadOS Hangul mirror, closing three review findings. The premise that iOS fires no composition events holds only for the hardware Korean keyboard. The iPad on-screen keyboard and the Japanese and Chinese IMEs do run a composition session, and xterm commits those by reading the helper textarea — which the mirror deliberately does not clear. Mirroring the preedit and then letting xterm commit the same field sent the text twice (`にほん` arrived as `にほんにほん`). The mirror now stands aside for the whole session and only clears its own bookkeeping at compositionend; the field belongs to xterm. The bypass predicate gains a matching isComposing guard. Mirror state also went stale whenever something else wrote to the PTY. reset() hung off a non-bypassed keydown, which Ctrl+C, Cmd+V paste and the JIS-Yen branch all skip, so the next syllable rewrite emitted DEL bytes against a line the shell no longer had. Replace it with a terminal.onData hook that resets on any write the mirror did not make. The blur listener is now filtered to the helper textarea, matching the input listener, so an unrelated focusable descendant no longer wipes the field mid-word.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughAdds iOS and iPadOS WebKit detection for mobile and desktop-mode iPads. Adds keyboard bypass rules for non-ASCII printable text during iOS editing. Adds a textarea mirror that converts Unicode edits into terminal erase bytes and appended text. Integrates the mirror with terminal lifecycle cleanup and terminal data resets. Adds tests for detection, keyboard handling, mirroring, composition, disposal, and edge cases. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 39081c7f-8f93-4b21-b3d5-234e7f946baa
📒 Files selected for processing (7)
src/renderer/src/components/terminal-pane/terminal-ios-text-edit-mirror.test.tssrc/renderer/src/components/terminal-pane/terminal-ios-text-edit-mirror.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.tssrc/renderer/src/components/terminal-pane/xterm-bypass-policy-ios.test.tssrc/renderer/src/components/terminal-pane/xterm-bypass-policy.tssrc/renderer/src/lib/ios-web-platform.test.tssrc/renderer/src/lib/ios-web-platform.ts
|
@dvpaa -- I'm just getting to this
|
|
Thanks for this @dvpaa — and sorry for the slow review. Your central architectural call is right, and it is the part we are keeping. The fix has to sit upstream of Your iOS detection is also exactly right, and it is a trap others have fallen into: We also confirmed Pinyin coexistence works with your bypass — driving a real Two bugs we found by running the code, which is why we are not merging this as-is: 1. The with zero DEL bytes emitted. The 2. That one is worse than it looks, because the bypass claims every unmodified non-ASCII key on iOS, so one stuck flag silently kills all non-ASCII typing on that pane — Cyrillic, Greek, kana — not just Korean. We shipped this exact bug class recently (a flag set but never expired disabled the Pinyin candidate-digit guard for a whole focus session), so we are being strict about it. One design note, not a bug: send-then-retract puts 19 writes and 8 DEL bytes on the wire for Where we landed: we are building a version that keeps your placement and bypass-policy extension, and holds the syllable in the renderer instead of retracting it. Your Also worth recording for anyone reading later: the merge conflict here is a non-issue — |
|
Thanks for the thorough review and detailed explanation, @nwparker! The breakdown of the two bugs ( Glad to hear the bypass placement and iOS detection logic were helpful. Looking forward to the follow-up PR, and I'd be more than happy to test it on my iPad with the hardware keyboard once it's ready! |
…enderer (#13345) (#15480) * fix(terminal): compose iPadOS Hangul by holding the syllable in the renderer (#13345) Korean typed on an iPad with a hardware keyboard reached the PTY as separate jamo: `한글깨짐` arrived as `ㅎㅏㄴㄱㅡㄹ...`. iPadOS fires no composition events for it — each jamo is a plain keydown while the IME rewrites the syllable in place in the helper textarea — so xterm consumes the keydown, sends the raw jamo from `_keyPress`, and drops the composed `insertText` because `_inputEvent` admits a composed insert only when no key is down. The jamo keydown is handed to the system by a new bypass rule, and the syllable it builds is held in the renderer until the IME proves it final. The PTY sees one write per syllable and nothing is ever sent then retracted, so raw-mode TUIs never receive DEL bytes they need not read as "erase one cell" and SSH and relay sessions pay no round trip for them. `한글깨짐` is four writes and zero DELs. Sitting upstream of `xterm-bypass-policy.ts` rather than inside xterm is what makes this work for Shift-typed double consonants: Orca's own Shift rule already hides `ㄲ ㄸ ㅃ ㅆ ㅉ` keydowns from xterm, so a fix living in CompositionHelper never sees them and every syllable starting with one — 깨 꿈 딸 빵 쓰다 짜다 — stays broken. That placement call is dvpaa's, from #13346. Composition sessions are left alone entirely, so Chinese pinyin on the same device keeps working; that state is derived from the existing composition tracker rather than latched, so a session that never ends cannot disable the pane. The bypass claims jamo only — a Cyrillic or kana key would lose its keydown, keypress and `input` alike and reach the PTY as nothing. Co-authored-by: dvpaa <[email protected]> * refactor(terminal): drop the dead session check from the iOS preedit input guard `isCompositionOwnedInput(event) || options.isCompositionActive()` could never take its second branch. The composition tracker's own `input` listener runs first on the same element and clears its active flag for every input except `insertCompositionText` — which is exactly the first disjunct. Verified by construction: instrumented to throw on the combination, nothing in the renderer suite (24k tests) reached it, and five deliberate attempts to build one, via a resumed preedit and a post-compositionend insert, all failed to. Reading composition ownership off the event alone also makes the decision independent of listener registration order, which the previous comment at the call site claimed to depend on. It does not: swapping the tracker and the preedit controller leaves every test passing. The comment now states the one coupling that is real — the controller stops propagation on `input` while a syllable is held — without asserting a behavioral dependency that does not exist. `isCompositionActive` remains the gate on opening a hold, where it is pinned. * fix(terminal): settle iPad Hangul by diffing the field, not assuming it grows The hold released a syllable only when the textarea tail grew past it and still started with it. Korean batchim migration breaks that: a device capture on iPadOS 26 shows `깨` + `ㅈ` rewritten to `깾` — a different codepoint, not an extension — and only becoming `깨주` once the next vowel decides where the `ㅈ` belongs. The prefix check failed there, the hold stopped advancing, and `깨쥠` reached the PTY as one chunk on blur. Locate the IME's edit with a prefix diff of the two field states instead. Everything before where it began rewriting is settled: the batchim question for those syllables is already answered. Still hold-and-commit, so no DEL ever reaches the pty. The capture is now the fixture, replayed both verbatim and as keystrokes. * fix(terminal): keep the iPad Hangul hold open across the IME's erase rewrite Backspace can decompose a held syllable as deleteContentBackward then a replacing insertText, the same shape the IME uses to grow one. The hold closed on the emptied half, so the replacement landed with nothing held: typing 한, Backspace, ㄹ put a bare `ㄹ` on the wire and dropped 하. The empty field now collapses the hold instead of closing it, and the Backspace that finds nothing held is the one that reaches the PTY. An `imeWrote` flag keeps an erased hold from resurrecting its opening jamo. Also diff the field as NFC. Decomposed Hangul grows by appending jamo, which the common-prefix diff reads as the previous syllable settling, so an NFD source emitted one bare jamo per keystroke. The recorded device trace is NFC, where normalization is a no-op. * test(terminal): cover Japanese, Hanja and Greek on the iPad Hangul path The coexistence suite proved pinyin and a short list of non-Hangul keys. Widen it: a kana-to-kanji session, a Hanja lookup over a live preedit, a digit that ends a held syllable as literal text, and Greek, halfwidth kana and accented Latin among the keys the bypass must not claim. --------- Co-authored-by: dvpaa <[email protected]>
|
Closing — #15480 has landed, and it keeps your architectural call. The decision to fix this above the terminal rather than inside it was yours, and it is the part that survived. The competing approach patched the vendored xterm and, sitting downstream of Orca's own bypass policy, never fixed Shift-typed jamo — so every syllable starting with a double consonant (깨, 꿈, 딸, 빵) still broke, including You are credited as co-author on the merged change. What differs: instead of mirroring field edits and retracting with DEL bytes, it holds the syllable and commits only what a common-prefix diff proves settled — 3 PTY writes and 0 DELs for Device-verified on a physical iPad against a recorded 34-event trace, which is committed as a fixture. Thanks for the PR and the review exchange — both changed the outcome. |
…enderer (stablyai#13345) (stablyai#15480) * fix(terminal): compose iPadOS Hangul by holding the syllable in the renderer (stablyai#13345) Korean typed on an iPad with a hardware keyboard reached the PTY as separate jamo: `한글깨짐` arrived as `ㅎㅏㄴㄱㅡㄹ...`. iPadOS fires no composition events for it — each jamo is a plain keydown while the IME rewrites the syllable in place in the helper textarea — so xterm consumes the keydown, sends the raw jamo from `_keyPress`, and drops the composed `insertText` because `_inputEvent` admits a composed insert only when no key is down. The jamo keydown is handed to the system by a new bypass rule, and the syllable it builds is held in the renderer until the IME proves it final. The PTY sees one write per syllable and nothing is ever sent then retracted, so raw-mode TUIs never receive DEL bytes they need not read as "erase one cell" and SSH and relay sessions pay no round trip for them. `한글깨짐` is four writes and zero DELs. Sitting upstream of `xterm-bypass-policy.ts` rather than inside xterm is what makes this work for Shift-typed double consonants: Orca's own Shift rule already hides `ㄲ ㄸ ㅃ ㅆ ㅉ` keydowns from xterm, so a fix living in CompositionHelper never sees them and every syllable starting with one — 깨 꿈 딸 빵 쓰다 짜다 — stays broken. That placement call is dvpaa's, from stablyai#13346. Composition sessions are left alone entirely, so Chinese pinyin on the same device keeps working; that state is derived from the existing composition tracker rather than latched, so a session that never ends cannot disable the pane. The bypass claims jamo only — a Cyrillic or kana key would lose its keydown, keypress and `input` alike and reach the PTY as nothing. Co-authored-by: dvpaa <[email protected]> * refactor(terminal): drop the dead session check from the iOS preedit input guard `isCompositionOwnedInput(event) || options.isCompositionActive()` could never take its second branch. The composition tracker's own `input` listener runs first on the same element and clears its active flag for every input except `insertCompositionText` — which is exactly the first disjunct. Verified by construction: instrumented to throw on the combination, nothing in the renderer suite (24k tests) reached it, and five deliberate attempts to build one, via a resumed preedit and a post-compositionend insert, all failed to. Reading composition ownership off the event alone also makes the decision independent of listener registration order, which the previous comment at the call site claimed to depend on. It does not: swapping the tracker and the preedit controller leaves every test passing. The comment now states the one coupling that is real — the controller stops propagation on `input` while a syllable is held — without asserting a behavioral dependency that does not exist. `isCompositionActive` remains the gate on opening a hold, where it is pinned. * fix(terminal): settle iPad Hangul by diffing the field, not assuming it grows The hold released a syllable only when the textarea tail grew past it and still started with it. Korean batchim migration breaks that: a device capture on iPadOS 26 shows `깨` + `ㅈ` rewritten to `깾` — a different codepoint, not an extension — and only becoming `깨주` once the next vowel decides where the `ㅈ` belongs. The prefix check failed there, the hold stopped advancing, and `깨쥠` reached the PTY as one chunk on blur. Locate the IME's edit with a prefix diff of the two field states instead. Everything before where it began rewriting is settled: the batchim question for those syllables is already answered. Still hold-and-commit, so no DEL ever reaches the pty. The capture is now the fixture, replayed both verbatim and as keystrokes. * fix(terminal): keep the iPad Hangul hold open across the IME's erase rewrite Backspace can decompose a held syllable as deleteContentBackward then a replacing insertText, the same shape the IME uses to grow one. The hold closed on the emptied half, so the replacement landed with nothing held: typing 한, Backspace, ㄹ put a bare `ㄹ` on the wire and dropped 하. The empty field now collapses the hold instead of closing it, and the Backspace that finds nothing held is the one that reaches the PTY. An `imeWrote` flag keeps an erased hold from resurrecting its opening jamo. Also diff the field as NFC. Decomposed Hangul grows by appending jamo, which the common-prefix diff reads as the previous syllable settling, so an NFD source emitted one bare jamo per keystroke. The recorded device trace is NFC, where normalization is a no-op. * test(terminal): cover Japanese, Hanja and Greek on the iPad Hangul path The coexistence suite proved pinyin and a short list of non-Hangul keys. Widen it: a kana-to-kanji session, a Hanja lookup over a live preedit, a digit that ends a held syllable as literal text, and Greek, halfwidth kana and accented Latin among the keys the bypass must not claim. --------- Co-authored-by: dvpaa <[email protected]> (cherry picked from commit 0743394)
…enderer (stablyai#13345) (stablyai#15480) * fix(terminal): compose iPadOS Hangul by holding the syllable in the renderer (stablyai#13345) Korean typed on an iPad with a hardware keyboard reached the PTY as separate jamo: `한글깨짐` arrived as `ㅎㅏㄴㄱㅡㄹ...`. iPadOS fires no composition events for it — each jamo is a plain keydown while the IME rewrites the syllable in place in the helper textarea — so xterm consumes the keydown, sends the raw jamo from `_keyPress`, and drops the composed `insertText` because `_inputEvent` admits a composed insert only when no key is down. The jamo keydown is handed to the system by a new bypass rule, and the syllable it builds is held in the renderer until the IME proves it final. The PTY sees one write per syllable and nothing is ever sent then retracted, so raw-mode TUIs never receive DEL bytes they need not read as "erase one cell" and SSH and relay sessions pay no round trip for them. `한글깨짐` is four writes and zero DELs. Sitting upstream of `xterm-bypass-policy.ts` rather than inside xterm is what makes this work for Shift-typed double consonants: Orca's own Shift rule already hides `ㄲ ㄸ ㅃ ㅆ ㅉ` keydowns from xterm, so a fix living in CompositionHelper never sees them and every syllable starting with one — 깨 꿈 딸 빵 쓰다 짜다 — stays broken. That placement call is dvpaa's, from stablyai#13346. Composition sessions are left alone entirely, so Chinese pinyin on the same device keeps working; that state is derived from the existing composition tracker rather than latched, so a session that never ends cannot disable the pane. The bypass claims jamo only — a Cyrillic or kana key would lose its keydown, keypress and `input` alike and reach the PTY as nothing. Co-authored-by: dvpaa <[email protected]> * refactor(terminal): drop the dead session check from the iOS preedit input guard `isCompositionOwnedInput(event) || options.isCompositionActive()` could never take its second branch. The composition tracker's own `input` listener runs first on the same element and clears its active flag for every input except `insertCompositionText` — which is exactly the first disjunct. Verified by construction: instrumented to throw on the combination, nothing in the renderer suite (24k tests) reached it, and five deliberate attempts to build one, via a resumed preedit and a post-compositionend insert, all failed to. Reading composition ownership off the event alone also makes the decision independent of listener registration order, which the previous comment at the call site claimed to depend on. It does not: swapping the tracker and the preedit controller leaves every test passing. The comment now states the one coupling that is real — the controller stops propagation on `input` while a syllable is held — without asserting a behavioral dependency that does not exist. `isCompositionActive` remains the gate on opening a hold, where it is pinned. * fix(terminal): settle iPad Hangul by diffing the field, not assuming it grows The hold released a syllable only when the textarea tail grew past it and still started with it. Korean batchim migration breaks that: a device capture on iPadOS 26 shows `깨` + `ㅈ` rewritten to `깾` — a different codepoint, not an extension — and only becoming `깨주` once the next vowel decides where the `ㅈ` belongs. The prefix check failed there, the hold stopped advancing, and `깨쥠` reached the PTY as one chunk on blur. Locate the IME's edit with a prefix diff of the two field states instead. Everything before where it began rewriting is settled: the batchim question for those syllables is already answered. Still hold-and-commit, so no DEL ever reaches the pty. The capture is now the fixture, replayed both verbatim and as keystrokes. * fix(terminal): keep the iPad Hangul hold open across the IME's erase rewrite Backspace can decompose a held syllable as deleteContentBackward then a replacing insertText, the same shape the IME uses to grow one. The hold closed on the emptied half, so the replacement landed with nothing held: typing 한, Backspace, ㄹ put a bare `ㄹ` on the wire and dropped 하. The empty field now collapses the hold instead of closing it, and the Backspace that finds nothing held is the one that reaches the PTY. An `imeWrote` flag keeps an erased hold from resurrecting its opening jamo. Also diff the field as NFC. Decomposed Hangul grows by appending jamo, which the common-prefix diff reads as the previous syllable settling, so an NFD source emitted one bare jamo per keystroke. The recorded device trace is NFC, where normalization is a no-op. * test(terminal): cover Japanese, Hanja and Greek on the iPad Hangul path The coexistence suite proved pinyin and a short list of non-Hangul keys. Widen it: a kana-to-kanji session, a Hanja lookup over a live preedit, a digit that ends a held syllable as literal text, and Greek, halfwidth kana and accented Latin among the keys the bypass must not claim. --------- Co-authored-by: dvpaa <[email protected]>
Summary
Korean typed on an iPadOS hardware keyboard reached the terminal as uncomposed
compatibility jamo in the
orca serveweb client —한글깨짐arrived asㅎㅏㄴㄱㅡㄹㄲㅐㅈㅣㅁ. It reproduces in both Safari and Chrome, which share thesystem WebKit engine on iOS.
iPadOS composes Hangul with a hardware keyboard by rewriting text it has
already committed —
deleteContentBackwardfollowed byinsertTextcarryingthe updated syllable — and fires no composition events at all. xterm consumed the
printable keydown and default-prevented it, so that logic never ran and the raw
jamo from
event.keywent to the PTY.Captured on iPadOS 26.5.2, an ordinary text field on the same page shows the
working path and the terminal shows the broken one, from identical keydowns:
ㅎinput insertText "ㅎ"(U+314E)ㅏdeleteContentBackward→insertText "하"(U+D558)ㄴdeleteContentBackward→insertText "한"(U+D55C)Exactly one key escaped in the terminal capture:
ㄲ, typed with Shift, whichmatched the existing Shift bypass in
xterm-bypass-policy.tsand produced thefull native
keypress/beforeinput/inputchain. That bypass is the controlgroup proving the mechanism.
Fixes #13345
What this changes
keypressincluded — without it_keyPressre-sends the glyph alongside themirror.
DEL × n + replacement, usingthe prefix-diff approach the mobile client already uses in
terminal-live-hangul-mirror.ts.Diffing the field rather than replaying edit events keeps a stray delete from
desyncing the PTY, and handles the non-1:1 case: typing
ㅣafter깾emits onedeletion and reinserts two characters.
Input sources that do run a composition session — the on-screen keyboard, the
Japanese and Chinese IMEs — are left entirely to xterm's
CompositionHelper,which already commits them correctly.
Not affected
No non-iOS platform.
shouldBypassXtermForIosTextEditreturns early when theflag is off, so desktop IME handling is untouched. In particular the macOS
native-text forwarder stays installed — deleting it is what regressed full-width
CJK punctuation in #13128 and forced the revert in #13282.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm testpnpm build—build:desktopand both native scripts pass individually; thebuild:nativewrapper cannot run on this machine, see below36 new tests across 3 files. The core one replays the 19-step field sequence
recorded on the affected device and asserts the PTY renders
한글깨짐with nocompatibility jamo left over, so a regression fails the test rather than
silently degrading. All 651 test files under
terminal-pane/andlib/pass.pnpm testreports 5 pre-existing failures on this machine(
check-root-directory-entries,terminal-attribution,runtime-auth-service,updater,remote-runtime-shared-control-connection). They reproduceidentically on
mainat 34f2a62 and live inconfig/scripts/,src/main/and
src/shared/— this change touches onlysrc/renderer/.pnpm buildcould not complete on this machine:build:nativere-invokes pnpmas
node $npm_execpath run <script>(
config/scripts/build-native-for-platform.mjs:19-27), which assumes aJavaScript entry point. With pnpm installed as the standalone
@pnpm/exebinary, Node parses that binary as JS and throws
SyntaxError: Invalid or unexpected token. This reproduces onmainat34f2a62 and CI is unaffected, since
pnpm/action-setupinstalls the JSdistribution. Everything the wrapper would have run passes on its own:
build:desktop,build:computer-macosandbuild:notification-status-macosall exit 0.
Device-verified on iPad Pro 12.9" (6th gen) / iPadOS 26.5.2 with a hardware
keyboard, against
orca serveon Linux.AI Review Report
Ran
/code-review(high) and/security-reviewon the branch. The reviewexplicitly covered cross-platform compatibility for macOS, Linux and Windows —
shortcuts, labels, paths, shell behavior and Electron-specific differences —
plus SSH/remote/local, agent and integration compatibility, performance and
security risk.
Three findings were raised and fixed:
intercepted
inputbut not the composition events, so on the iPad on-screenkeyboard or a Japanese IME the mirror sent preedit text and then xterm's
_sendPendingCompositionsent the same text again from the field, yieldingにほんにほん. Fixed by standing aside for the whole composition session andadding an
isComposingguard to the bypass predicate.reset()washooked only to a non-bypassed keydown, so Ctrl+C, Cmd+V paste and the JIS-Yen
branch each left
sentTextdescribing a line the shell no longer had; thenext syllable rewrite then emitted DEL bytes against it. Replaced with a
terminal.onDatahook that resets on any write the mirror did not make,which covers all three plus xterm's own key handling.
blurlistener (low). Any focusable descendant blurring wipedmirror state and the field. Now filtered to the helper textarea, matching the
inputlistener.Cross-platform: the iOS branch is the only behavior change; every other
platform short-circuits before it. No shortcut, label, path or shell behavior is
touched, and nothing Electron-specific changes — this path only runs in the web
client.
SSH/remote/local: client-side input handling only. No RPC param, stream
frame or published content changes, so
docs/reference/remote-wire-compatibility.mddoes not apply. The mirror writes through
terminal.input(), i.e. the existingonDatapath, so the pane's replay guard, stale-agent block and mobile presencelock all still run.
Agents and integrations: the bytes reaching the PTY are ordinary text plus
DEL (
0x7f). No agent-, integration- or git-provider-specific branching.Performance: one prefix comparison per input event, linear in the field
length and only while a CJK syllable is being composed. No new timers,
listeners on hot paths, or renders.
UI quality: no visual change.
Security Audit
/security-reviewfound no HIGH or MEDIUM issues. Checked and ruled out:terminal.input(), which lands on the sameonDatapath as existing input,so the pane's guards still run.
inputlistener.TerminalPane.tsxregistersa capture-phase
pastelistener on the pane-manager root and callspreventDefault(), so no default insertion and noinputevent occurs. Theclipboard therefore still goes through the existing paste path rather than
being forwarded raw.
z-index: -5and loses hit-testing.codePoint >= 0x80with noCtrl/Meta/Alt, so no C0 byte or ESC can enter through it. The only control
byte the mirror emits is DEL, and the count is bounded by the length of text
the mirror itself sent.
stopImmediatePropagation()suppresses nothing security-relevant — onlylater-registered listeners on the same node, which is xterm's own input
handling, by design.
handling or IPC surface is touched.
Notes
Mac—Macintoshin iPad desktop mode, the default since iPadOS 13, andlike Mac OS Xin mobile mode — and desktop mode omitsiPad, somaxTouchPointsis the only thing separating an iPad from a Mac.shouldBypassXtermForMacNativeTextrefuses to bypass while kitty progressiveenhancement is active. The iOS branch deliberately does not, because gating on
it would leave Korean broken in exactly the agent TUIs that enable kitty mode.
Happy to add the guard if you would rather keep CSI-u reporting intact there.
through xterm's composition path rather than the mirror, but has not been
device-tested. Chinese and Japanese IMEs on iPadOS are likewise untested.
the mobile client already ships.
mobile/is a separate pnpm workspace, so its equivalent mirror could notbe imported directly; the shared algorithm is noted in the code comments
instead of being extracted into a package, which felt out of scope here.