Repository navigation
[Bugfix #253] Fix mobile terminal input duplication from IME composition - #256
Merged
waleedkadous merged 2 commits intoFeb 14, 2026
Merged
Conversation
On mobile browsers, all keyboard input goes through IME composition. Some browsers fire both input and compositionend events, causing xterm.js to emit onData twice for the same keystroke, resulting in duplicated text. Track composition state via xterm's textarea and skip exact duplicate onData calls during active composition.
Tests verify that duplicate onData calls during IME composition are suppressed, different characters pass through, dedup is inactive without composition, and the dedup window resets after timeout.
Contributor
Author
CI Status NoteAll CI failures are pre-existing (also fail on main): Unit Tests (4 failures):
Tower Integration Tests (3 failures):
None relate to Terminal/IME changes. Dashboard terminal tests all pass (23/23). |
waleedkadous
deleted the
builder/bugfix-253-mobile-typed-text-gets-duplica
branch
February 14, 2026 14:20
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes #253
Root Cause
On mobile browsers, all keyboard input goes through IME composition. Some browsers fire both
inputandcompositionendevents, causing xterm.js to emitonDatatwice for the same keystroke. TheonDatahandler inTerminal.tsxsent every call directly to the PTY via WebSocket, so the character was written to the shell twice and echoed back twice — appearing as duplicated text.Fix
Track composition state by listening to
compositionstartandcompositionendevents on xterm's hidden textarea element. During active IME composition (and for 100ms aftercompositionend), exact duplicateonDatacalls are suppressed. This only activates during composition, so desktop key repeat is unaffected.Changes:
packages/codev/dashboard/src/components/Terminal.tsx(+40 lines)Test Plan
Terminal.ime-dedup.test.tsx, 5 tests)Note: 4 pre-existing test failures exist on main (StatusPanel, init timeout, pty-session resume) — unrelated to this change.