Repository navigation
Conversation
Co-authored-by: Orca <[email protected]>
|
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 (3)
📝 WalkthroughWalkthroughThe IME utilities now distinguish consumed Process/229 keys from deferred physical Enter and NumpadEnter events. The keyboard handler filters consumed non-Enter keys before shortcut resolution and propagation, while composed Enter events remain deferred and send 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
Greptile SummaryThis PR fixes a Windows IME bug where any IME-consumed key (reported as
Confidence Score: 5/5Safe to merge — the fix is narrowly scoped to Windows IME composition and all existing and new tests pass. The change makes a precise, well-bounded correction: it adds a physical key-code check to a single predicate and a matching stopImmediatePropagation guard. The happy paths (Shift+Enter, Ctrl+Enter deferred newline) are covered by regression tests, and the previously-broken paths (Shift+KeyQ, Ctrl+KeyI, Ctrl+KeyK, Ctrl+KeyW during composition) now have explicit test coverage. No logic outside the Windows IME composition path is touched. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.ts | Extracts isTerminalImeConsumedKey as a named helper and adds a code guard to isTerminalImeProcessEnter so only 'Enter'/'NumpadEnter' physical keys are treated as IME-Enter; the empty-code fallback path is explicitly documented. |
| src/renderer/src/components/terminal-pane/keyboard-handlers.ts | Adds a guard that calls stopImmediatePropagation() for any Windows IME-consumed non-Enter key during composition, preventing Ctrl+K/Ctrl+W and window-level shortcuts from misfiring mid-IME. |
| src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.test.ts | Adds code: 'Enter' as default in the event factory and extends rejection cases with KeyQ and KeyI; NumpadEnter acceptance cases added for both shift and ctrl paths. |
| src/renderer/src/components/terminal-pane/keyboard-handlers-ime.test.tsx | Exposes sendInput mock on the harness and adds three new integration test groups: non-Enter IME chords don't trigger sendInput or pane shortcuts, window-level handlers don't see swallowed Ctrl chords, and Shift+Enter still defers correctly via both Enter and NumpadEnter codes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Windows keydown during IME composition] --> B{isTerminalImeConsumedKey\nkey=Process and keyCode=229}
B -- No --> F[Normal shortcut resolution]
B -- Yes --> C{code is Enter or NumpadEnter}
C -- Yes with shift or ctrl --> D[Synthesize Enter event\nDefer send after compositionend]
C -- No --> E[stopImmediatePropagation\nReturn, no shortcut fires]
D --> G[sendInput after composition ends]
E --> H[IME composition continues uninterrupted]
Reviews (2): Last reviewed commit: "fix(terminal): keep IME-consumed Process..." | Re-trigger Greptile
Co-authored-by: Orca <[email protected]>
|
Confirming this on Windows 11 + Microsoft 두벌식 (2-set Korean), Orca v1.4.163. I hit it during normal typing, not while testing edge cases. Scope is wider than double consonants2-set Korean needs Shift for seven jamo, and all seven reproduce:
The two vowels (ㅒ ㅖ) reproducing is the useful part: they go through different composition logic than the consonants, so this rules out anything jamo-specific and pins it to the modifier-flag-only check — exactly what this PR fixes. Any framing of this as a "double consonant" bug is too narrow. Words that hit it constantly: It only fires when the Shift-jamo lands mid-word (a composition is already pending), consistent with the Both halves of the symptom
Reading the diff, this PR addresses both: the predicate change stops the synthesized Enter (so The red CI is an infrastructure flakeWorth flagging since this is P1 and currently reads as broken:
The same shard on Node 26 passed, as did the other 31 shards, static analysis, typecheck, package, and the Linux X11 IBus IME suite. A re-run should clear it. Possible collision with #11550#11550 edits the same lines of One thing worth preserving from this PR: #11550 does not include the swallow branch for IME-consumed chords, so Related issueI filed #11878 for this before finding this PR. Note that the "Likely code path" section in that issue is wrong — it blames a stale Two questions, not objections
I have the setup to capture a full native event trace (window-capture keydown/keyup + composition events, including |
|
Heads up — I've opened #12120 as a draft that carries both of your commits here The reason for bundling: each of the four PRs closes one event path, but a user typing This is not meant to supersede your PR, and I'd be glad if maintainers just landed yours. |
|
Still reproduces on v1.4.164, the current latest release — so no shipped build fixes this yet. Environment
Symptom Adding this mainly as a version data point rather than new analysis: v1.4.163 already shipped the IME composition integration from #11293, and v1.4.164 is the current release, so the The diagnosis here — and in the Greptile summary above — matches exactly what I see. Nothing to add to it. Just flagging that it is hitting real users on the current release, and that this PR has had no review since 2026-07-30. |
A Shift-jamo consumed as Process/229, the plain committing Enter that follows, and the rollover Shift for the next doubled consonant exercise the stablyai#11616 and stablyai#11937 fixes in one session. Each half was covered separately; this fails on main and passes here.
Adapted from #11616 commit 9f449d7 and #12120 commit 290f42a. Co-authored-by: holdn2 <[email protected]>
Adapted from #11616 commit 9f449d7 and #12120 commit 290f42a. Co-authored-by: holdn2 <[email protected]>
Adapted from #11616 commit 9f449d7 and #12120 commit 290f42a. Co-authored-by: holdn2 <[email protected]>
|
Closing as superseded by #12265, which landed the physical-Enter classification together with the broader Windows IME shortcut guard and regression coverage. Thank you for isolating and validating the original failure mode. |
|
thanks for reporting. looking into it |
Adapted from stablyai#11616 commit 9f449d7 and stablyai#12120 commit 290f42a. Co-authored-by: holdn2 <[email protected]>
Summary
key='Process'/keyCode=229, soisTerminalImeProcessEntermatched any modified IME-consumed key, not just Enter.keyboard-handlers.tsthen synthesized an Enter event andterminal-shortcut-policy.tsinjected\x1b\r/\x1b[13;5uinto the shell.isTerminalImeProcessEnternow also requires the physical key code to beEnterorNumpadEnter, which Chromium reports faithfully even when the IME consumes the key.keyboard-handlers.tsalready forwards the original event with its.code.Test plan
terminal-ime-deferred-newline.test.tsunit cases: rejectscode: 'KeyQ'(shift) andcode: 'KeyI'(ctrl), acceptscode: 'Enter'andcode: 'NumpadEnter'for both shift and ctrl kinds.keyboard-handlers-ime.test.tsx: IME-consumed Shift+KeyQ / Ctrl+KeyI during composition are not swallowed and send no input; Process+code Enter/NumpadEnter still defers and sends\x1b\rafter composition (regression guard for fix(terminal): reconcile cross-platform IME composition lifecycle #11293).git stashof the production change): 4 failures, e.g.does not treat an IME-consumed 'Shift+KeyQ' as a modified Enter—AssertionError: expected true to be falseondefaultPrevented; all 45 tests pass with the fix restored.xterm-bypass-policy,keyboard-handlers,terminal-ime-deferred-newline,keyboard-handlers-ime,terminal-pane-split-writer-paths): 94 passed.npx oxlintandtsc -p config/tsconfig.tc.web.jsonclean.Found by the production release scan of v1.4.162..v1.4.163-rc.0.
Made with Orca 🐋