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
Touch IME bridge: decide behaviour for alternate-screen apps and CJK composition #1887
PR #1884 (the fix for issue #1883, mobile autocomplete duplicating text) adds a touch-only IME bridge (apps/web/src/lib/imeInput.ts). On (pointer: coarse) devices it keeps composition and input events away from xterm.js and sends each textarea edit to the PTY live, as DELs plus new text. In a line editor this converges to exactly what the keyboard shows. Two cases where live streaming behaves differently from stock xterm need a decision. Neither has been tried on a real device.
1. Alternate-screen apps (vim normal mode, less, fzf, TUI menus)
There, the bytes are commands, not text. Composing text streams letter by letter, and when the keyboard revises it (autocomplete, autocorrect), the bridge sends DELs and the new text. In vim normal mode a DEL moves the cursor left and each letter is a command. Stock xterm was also wrong here: it resent the whole textarea on such edits, which is the #1883 bug itself. So this is not a regression, but it is a different wrong.
Option: bypass the bridge while term.buffer.active.type === 'alternate', and let xterm's own handlers run. That brings back stock behaviour, including its resend bug, for full-screen apps.
2. CJK input on touch devices
xterm's composition overlay never activates on touch, because the bridge shields composition events. Intermediate composing text (kana) streams to the PTY as it is typed, then is retracted with DELs and replaced when the IME converts it (kanji). The bytes converge in a line editor. But the user sees the kana appear on the line before conversion, the shell sees every intermediate edit, and stock xterm sent only the committed text at compositionend.
Options: buffer while a composition is active and send at compositionend (the issue's original prescription; it means typing blind for Latin keyboards, which compose every word), or do that only for non-Latin IMEs.
To decide
Try both on a phone (Android Gboard and iOS, with a Japanese or Chinese keyboard for case 2; vim for case 1). Then choose per case: keep, bypass, or buffer.
Raised by the PR review of PR #1884 (codex and claude).
Status 2026-11-10: the bridge is confirmed on a real Android Chrome device by the owner (see #1883). iOS Safari is still unverified on real hardware, in addition to the alternate-screen and CJK questions here.
Activity
[Bugfix #1883] Thread: CMAP round 4 and follow-up #1887
waleedkadous commentedon Nov 10, 2026
Status 2026-11-10: the bridge is confirmed on a real Android Chrome device by the owner (see #1883). iOS Safari is still unverified on real hardware, in addition to the alternate-screen and CJK questions here.