Skip to content

fix(terminal): reconcile cross-platform IME composition lifecycle - #11293

Merged
OrcaWin merged 28 commits into
mainfrom
review-ime-combined-11011-11052
Jul 29, 2026
Merged

OrcaWin merged 28 commits into
mainfrom
review-ime-combined-11011-11052

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This unifies the terminal IME fixes from:

All contributor commits and authorship are preserved. The integration then reconciles the overlapping xterm and renderer ownership models exposed by combined, native, and adversarial testing.

What changed

  • preserve authoritative textarea and selection progress across rapid composition restarts
  • defer ambiguous stale compositionend events until their transaction can be reconciled
  • retain transaction-owned PTY routes through completion, cancellation, replacement, reconnect, blur, and disposal
  • settle or abort every accepted xterm composition transaction without duplicating or dropping bytes
  • preserve plain, Shift, and Ctrl Enter ordering across IME commit boundaries
  • route the Korean ₩ key through native text so macOS key-binding remaps can emit backtick
  • keep timer and transaction ownership bounded and coalesced

Root causes

The three fixes overlapped at the composition boundary:

  1. xterm and Chromium can report the same native text through different event sequences, so timestamp- or value-only deduplication can either duplicate a commit or discard a legitimate repeated Hangul commit.
  2. Rapid restarts can deliver an old compositionend after the next transaction has updated the textarea, requiring transaction-owned textarea progress rather than global current/previous state.
  3. Enter chords and the Korean ₩ key may be represented differently between keydown, composition, and native text events, so forwarding must be owned until composition finalization instead of decided by one event in isolation.

Validation

Final landing branch:

Independent source-built Linux/X11 IBus validation produced exact PTY bytes for 60/60 sequences: 30 한abc글 repetitions and 30 sentence-stress repetitions. A pristine xterm rebuild was byte-identical for CJS, ESM, and both source maps.

Exact-parent red controls, real installed CJS/ESM DOM and PTY-byte oracles, rapid restarts, stale ends, duplicate ends, repeated commits, blur, disposal, transport replacement, SSH reconnect, and bounded transaction bursts were also verified.

Remaining native coverage

Physical macOS and Windows input-source runs, native Japanese and Chinese engines, and live native SSH/folder-workspace journeys were not repeated on the final landing hash. Their event, transport, and workspace invariants are covered deterministically, and the final branch passed the platform CI listed above.

This PR supersedes #11011, #11052, and #11177.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds terminal IME composition-session routing, deferred newline handling, modified-Enter processing, and PTY-safe captured-input dispatch. Expands xterm and browser E2E coverage with IME event probes, byte readers, observed event sequences, exact-byte scenarios, and macOS-style Enter tests. Adds native IBus Hangul tests with isolated X11 lifecycle management and evidence capture. Adds a GitHub Actions workflow, package script, and workflow validation test.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is informative, but it is missing required template sections for Screenshots, Testing, AI Review Report, Security Audit, and Notes. Add the missing template sections, including screenshot status, test checklist/results, AI review, security audit, and platform-specific notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 4.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: reconciling cross-platform IME composition lifecycle behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR reconciles three overlapping IME fixes (#11011, #11052, #11177) into a single unified branch, addressing Korean/IBus composition lifecycle, IME Enter and newline ordering, and Korean ₩/backtick native-text routing. The integration resolves ownership-model conflicts exposed by combined, native, and adversarial testing.

  • Introduces terminal-ime-composition-route.ts to own xterm composition sessions per-transport, terminal-ime-deferred-newline.ts to defer Enter keystrokes until composition settles, and terminal-captured-input-dispatch.ts to validate transport identity at send time.
  • Rewrites keyboard-handlers.ts to track held modifiers via heldImeEnterModifiers, unify the keyup handler, and gate modified-Enter paths through modifiedEnterChordOwner and deferredNewlineSender.
  • Intentionally changes three deduplication test expectations (keypresses previously dropped to avoid theoretical duplicates are now preserved), backed by an extensive regression matrix (2,791 unit-test cases + 233 IME scenarios).

Confidence Score: 5/5

Safe to merge; all findings are edge-case defensive improvements rather than regressions on any tested path.

The change is backed by an unusually extensive validation suite (2,791 unit tests, 233 combined IME scenarios, 60 native IBus sequences, and 27 adversarial cases), and the code correctly disposes all listeners, timers, and session state across blur, reconnect, and pane lifecycle events. The one structural concern — event.preventDefault() firing before the session-map lookup — only affects the extreme edge case of a composition session that started before the route was installed (mid-composition transport reconnect), a scenario that is also protected downstream by the transport-identity check in sendCapturedTerminalInput.

Files Needing Attention: terminal-ime-composition-route.ts (the preventDefault-before-lookup ordering in onSessionEnd) and terminal-ime-native-text-forwarder.ts (the boolean vs. counter for overlapping accepted transactions).

Important Files Changed

Filename Overview
src/renderer/src/components/terminal-pane/terminal-ime-composition-route.ts New module owning xterm composition-session events per transport; event.preventDefault() is called before the session-lookup, which can silently drop composition data for sessions started before the route was installed.
src/renderer/src/components/terminal-pane/keyboard-handlers.ts Major refactor: modifiers tracked via Set, onModifierUp merged into onKeyUp, modifier-Enter chord ownership wired through new IME primitives. Logic is complex but consistent with the documented design.
src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.ts New module for deferred Enter dispatch after composition ends; state keyed by (code, timeStamp), with 200 ms fallback timer. Side-effect of clearCreditsForCode on failed absorb already noted in previous review thread.
src/renderer/src/components/terminal-pane/terminal-ime-native-text-forwarder.ts Adds compositionTransactionPending boolean flag gated on accepted/settled custom events; suppresses insertText input events during an active xterm composition transaction.
src/renderer/src/components/terminal-pane/terminal-captured-input-dispatch.ts New helper that validates transport identity (captured vs current PTY ID) before dispatching input; straightforward and correct.
src/renderer/src/components/terminal-pane/pty-connection.ts Integrates the new composition route: installed at connection time, disposed in the cleanup path.
src/renderer/src/components/terminal-pane/terminal-ime-native-text-candidates.ts Adds ₩ to CJK_DIRECT_PUNCTUATION_KEYS so macOS DefaultKeyBinding.dict remaps can emit backtick instead.
config/patches/@[email protected] Large minified-bundle patch; adds XTERM_COMPOSITION_SESSION_START/END custom events that the new composition route depends on. Previously flagged as unauditable — no change to that concern.
.github/workflows/terminal-ime-e2e.yml New CI workflow running Linux X11 IBus Hangul exact-byte E2E tests on PR and daily schedule; structure is correct.
test-results/pr-11293-11177-integration-r1.md Integration audit logs committed as permanent repo artifacts; not a bug but adds permanent history noise.

Sequence Diagram

sequenceDiagram
    participant User
    participant Chromium
    participant KeyboardHandlers as keyboard-handlers.ts
    participant DeferredNewline as IME deferred-newline
    participant ChordOwner as ModifiedEnterChordOwner
    participant CompRoute as composition-route.ts
    participant xterm
    participant PTY

    User->>Chromium: Shift down (modifier)
    Chromium->>KeyboardHandlers: keydown(Shift)
    KeyboardHandlers->>KeyboardHandlers: heldImeEnterModifiers.add('shift')

    User->>Chromium: Enter down (during composition)
    Chromium->>KeyboardHandlers: "keydown(Process/Enter, isComposing=true)"
    KeyboardHandlers->>ChordOwner: "claim({kind:'shift', code, ts})"
    KeyboardHandlers->>DeferredNewline: defer(enter, element, sendFn)
    Note over DeferredNewline: waits for compositionend / session-end

    Chromium->>xterm: compositionend
    xterm->>CompRoute: XTERM_COMPOSITION_SESSION_END_EVENT
    CompRoute->>CompRoute: sessions.get(id) captured
    CompRoute->>xterm: terminal.input(data)
    CompRoute->>DeferredNewline: "session-end fires -> finish()"
    DeferredNewline->>PTY: sendFn() (Shift+Enter sequence)

    Chromium->>KeyboardHandlers: "keydown(Enter, isComposing=false) re-dispatch"
    KeyboardHandlers->>ChordOwner: "absorb({kind:'shift'}) -> true"
    KeyboardHandlers->>KeyboardHandlers: preventDefault, stopImmediatePropagation

    Chromium->>KeyboardHandlers: keyup(Enter)
    KeyboardHandlers->>ChordOwner: "absorb -> true -> release"
    KeyboardHandlers->>DeferredNewline: releaseRedispatchedEnter

    Chromium->>KeyboardHandlers: keyup(Shift)
    KeyboardHandlers->>KeyboardHandlers: heldImeEnterModifiers.delete('shift')
    KeyboardHandlers->>ChordOwner: "release({kind:'shift'})"
Loading

Reviews (6): Last reviewed commit: "test(terminal): harden IME workflow cove..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (7)
src/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.ts (2)

137-148: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Same non-parameterized it.each pattern as Lines 61-70.

"terminal close" and "tab unmount" both just call route.dispose(); the labels suggest coverage that isn't there.


61-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

it.each cases in this file don't use their parameters, so each label runs identical code. The root cause is the same in both blocks: the case list describes distinct lifecycle scenarios but the callback ignores the argument.

  • src/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.ts#L61-L70: drive the described blur/tab-switch/split-pane transition per case, or collapse to a single it.
  • src/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.ts#L137-L148: same — either simulate close vs unmount distinctly or collapse to a single it.
src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.test.ts (1)

336-351: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Interpolate the it.each case into these titles.

Both blocks emit identical test names for every case, so a failure doesn't identify which modifier combination broke.

♻️ Proposed titles
   it.each([{ shiftKey: true }, { shiftKey: false, ctrlKey: true }])(
-    'recognizes a Windows IME modifier Enter reported as Process',
+    'recognizes a Windows IME modifier Enter reported as Process (%o)',
     (modifiers) => {
-  ])('rejects a non-IME or ambiguous Process key', (override) => {
+  ])('rejects a non-IME or ambiguous Process key (%o)', (override) => {
src/renderer/src/components/terminal-pane/terminal-captured-input-dispatch.test.ts (1)

16-52: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

it.each labels imply SSH coverage the fixtures don't provide.

Both cases run byte-identical code (createTransport('pty-original')); no SSH-specific transport shape is exercised, so the "SSH remote runtime" name overstates coverage. Either vary the fixture (e.g. a remote-runtime PTY id) or drop it.each.

♻️ Vary the fixture per case
-  it.each(['local IPC', 'SSH remote runtime'])(
-    'sends on the captured %s route while its PTY still owns the mounted pane',
-    () => {
-      const transport = createTransport('pty-original')
+  it.each([
+    ['local IPC', 'pty-original'],
+    ['SSH remote runtime', 'ssh:host:pty-original']
+  ])(
+    'sends on the captured %s route while its PTY still owns the mounted pane',
+    (_label, ptyId) => {
+      const transport = createTransport(ptyId)
src/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-deduplication.test.ts (1)

473-488: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

toBeLessThanOrEqual(1) can never fail here.

getPendingFinalizationCount (Line 131) returns pending === undefined ? 0 : 1, so the bound is structural, not observed. To actually assert turnover behavior, expose the real pending set size (or assert toBe(1) during the loop and toBe(0) after the flush).

tests/e2e/terminal-ime-byte-reader.ts (1)

46-56: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reader invocation is POSIX-shaped; document or guard the Windows case.

node ${JSON.stringify(scriptPath)} emits JSON backslash escaping ("C:\\repo\\.orca-...cjs"), which cmd.exe/PowerShell do not unescape, so this helper only works under a POSIX shell. Today the only consumer (tests/e2e/terminal-ime-exact-byte.spec.ts) is Linux-gated, but the module reads as generic. Either note the POSIX-only contract here or normalize the path per platform. As per coding guidelines, "code, commands, and scripts must work on macOS, Linux, and Windows".

Source: Coding guidelines

.github/workflows/terminal-ime-e2e.yml (1)

58-61: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Ad-hoc global npm install outside the lockfile.

Static analysis flags installing node-gyp globally via npm install -g as an ad-hoc package install outside the lockfile. It's pinned to an exact version (11.5.0), so risk is limited, but consider using pnpm add -g (for consistency with the rest of the workflow's package manager) or vendoring via a dev dependency if this becomes a recurring pattern.

Source: Linters/SAST tools


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2aef5b15-cec2-48dc-8b95-4468b1266da2

📥 Commits

Reviewing files that changed from the base of the PR and between adc10cd and c72d08c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • .github/workflows/terminal-ime-e2e.yml
  • config/patches/@[email protected]
  • config/scripts/run-terminal-ibus-hangul-e2e.mjs
  • config/scripts/terminal-ime-e2e-workflow.test.mjs
  • package.json
  • src/renderer/src/components/terminal-pane/keyboard-handlers.ts
  • src/renderer/src/components/terminal-pane/pty-connection.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/terminal-captured-input-dispatch.test.ts
  • src/renderer/src/components/terminal-pane/terminal-captured-input-dispatch.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-composition-route.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.test.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-deduplication.test.ts
  • tests/e2e/korean-ime-terminal-shift-enter-commit.spec.ts
  • tests/e2e/terminal-ibus-hangul-native.spec.ts
  • tests/e2e/terminal-ime-boundary-probe.ts
  • tests/e2e/terminal-ime-byte-reader.ts
  • tests/e2e/terminal-ime-exact-byte.spec.ts
  • tests/e2e/terminal-ime-observed-event-sequences.ts

Comment thread .github/workflows/terminal-ime-e2e.yml Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
config/patches/@[email protected] (1)

41-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

instanceof CompositionHelper checks throughout CoreBrowserTerminal suggest an interface/implementation split that isn't reflected in the type system here.

Repeated this._compositionHelper instanceof CompositionHelper guards (for blur, compositionend, dispose, keypress) imply _compositionHelper's declared type is a broader interface with optional members, forcing runtime type checks instead of relying on the type checker. If there is truly only one implementation, consider typing _compositionHelper as CompositionHelper directly and dropping the guards; if multiple implementations exist, consider adding the new methods (blur, dispose, keypress, input) to the shared interface as optional members so call sites don't need instanceof.

Also applies to: 55-61, 68-74, 289-301

src/renderer/src/components/terminal-pane/keyboard-handlers-ime.test.tsx (1)

31-113: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Harness teardown isn't guaranteed on assertion failure.

dispose() (route disposal + scope.remove()) is only invoked manually as the last statement in each test. If an expect(...) throws earlier, scope's DOM nodes and the composition route's listeners leak into document.body for the remainder of the describe block, since afterEach only calls testing-library's cleanup() and timer/mock restoration — it never touches scope or route. This can cause confusing cascading failures in later it.each iterations/tests (duplicate .xterm-helper-textarea nodes, stray listeners).

Register teardown so it always runs, e.g. via Vitest's onTestFinished, instead of relying on the last line of each test body.

♻️ Suggested fix
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import { afterEach, beforeEach, describe, expect, it, onTestFinished, vi } from 'vitest'
   const route = installTerminalImeCompositionRoute({ ... })
+  onTestFinished(() => {
+    route.dispose()
+    scope.remove()
+  })
   const deps: KeyboardHandlersDeps = { ... }
   return {
     deps,
     editable,
     terminalInput,
-    startComposition: () => { ... },
-    dispose: () => {
-      route.dispose()
-      scope.remove()
-    }
+    startComposition: () => { ... }
   }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ad8ac14-2176-41fa-8621-ebf7c3524ebe

📥 Commits

Reviewing files that changed from the base of the PR and between c72d08c and d475739.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • config/patches/@[email protected]
  • src/renderer/src/components/terminal-pane/keyboard-handlers-ime.test.tsx
  • src/renderer/src/components/terminal-pane/keyboard-handlers.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-deduplication.test.ts
  • tests/e2e/korean-ime-terminal-shift-enter-commit.spec.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/renderer/src/components/terminal-pane/terminal-ime-xterm-composition-deduplication.test.ts
  • tests/e2e/korean-ime-terminal-shift-enter-commit.spec.ts
  • src/renderer/src/components/terminal-pane/keyboard-handlers.ts

AmethystLiang and others added 25 commits July 29, 2026 02:51
- Add deterministic xterm boundary tests and a Linux/X11 native IBus Hangul E2E runner
- Patch xterm composition handling and expand unit coverage for commit deduplication and retention
- Wire a scheduled GitHub Action to install IME tooling, run the new suites, and archive evidence
macOS Korean input sources put ₩ (U+20A9) on Backquote, so users remap it
to ` via ~/Library/KeyBindings/DefaultKeyBinding.dict. AppKit applies that
substitution in the text input path, and Chromium surfaces it only on the
keypress/input events — keydown still carries the raw ₩. xterm derives the
PTY payload from keydown.key and preventDefault()s, which suppresses the
Char event, so the remapped ` never reaches the shell.

₩ fell through every existing guard: CJK_DIRECT_PUNCTUATION_KEYS has ¥
(U+FFE5) but not ₩, the non-ASCII xterm bypass is scoped to shifted keys,
and the JIS Yen rewrite is scoped to code === 'IntlYen'. Claiming it as a
native-text candidate routes the keydown around xterm so the committed
glyph is forwarded from the input event.

Fixes #11170
Him188 added a commit to Him188/orca that referenced this pull request Aug 1, 2026
Backspacing away an entire Pinyin preedit ended the composition with
empty data, no textarea residue, and no input/keypress events — yet
_sendPendingComposition fell back to the last non-empty
compositionupdate data and typed its first character into the PTY.
Only trust that fallback when observed input evidence corroborates it;
a composition with no evidence in any channel was cancelled.

Fixes the macOS Pinyin regression from stablyai#11293 (stray letter left after
deleting a preedit); same fix covers IBus/fcitx Backspace cancellation.

Co-Authored-By: Claude Fable 5 <[email protected]>
kunsanglee added a commit to kunsanglee/orca that referenced this pull request Aug 1, 2026
…rejection

stablyai#11293 records the Windows Process sequence arriving with a blank `code` (see
"owns one Windows Process sequence across changing timestamps and blank codes"),
so requiring code Enter/NumpadEnter would have dropped a real committing Enter
on that path. An undeterminable code now keeps its previous verdict; only a
known non-Enter physical code, which is what a shifted jamo carries, is refused.

Also pins the two guards this branch relies on and had left untested: the
Windows chord slot stays free for a Ctrl+Enter behind a deferred Ctrl+Backspace,
and the composition marker is never read as its own re-dispatch. Both were
verified to fail without the guard they cover.
OrcaWin pushed a commit that referenced this pull request Aug 3, 2026
Backspacing away an entire Pinyin preedit ended the composition with
empty data, no textarea residue, and no input/keypress events — yet
_sendPendingComposition fell back to the last non-empty
compositionupdate data and typed its first character into the PTY.
Only trust that fallback when observed input evidence corroborates it;
a composition with no evidence in any channel was cancelled.

Fixes the macOS Pinyin regression from #11293 (stray letter left after
deleting a preedit); same fix covers IBus/fcitx Backspace cancellation.

Co-Authored-By: Claude Fable 5 <[email protected]>
nwparker pushed a commit that referenced this pull request Aug 3, 2026
Backspacing away an entire Pinyin preedit ended the composition with
empty data, no textarea residue, and no input/keypress events — yet
_sendPendingComposition fell back to the last non-empty
compositionupdate data and typed its first character into the PTY.
Only trust that fallback when observed input evidence corroborates it;
a composition with no evidence in any channel was cancelled.

Fixes the macOS Pinyin regression from #11293 (stray letter left after
deleting a preedit); same fix covers IBus/fcitx Backspace cancellation.

Co-Authored-By: Claude Fable 5 <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Backspacing away an entire Pinyin preedit ended the composition with
empty data, no textarea residue, and no input/keypress events — yet
_sendPendingComposition fell back to the last non-empty
compositionupdate data and typed its first character into the PTY.
Only trust that fallback when observed input evidence corroborates it;
a composition with no evidence in any channel was cancelled.

Fixes the macOS Pinyin regression from stablyai#11293 (stray letter left after
deleting a preedit); same fix covers IBus/fcitx Backspace cancellation.

Co-Authored-By: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants