Commit b5d72f5
Fix Korean IME data being eaten on fast input and make composition view visible
xterm.js's CompositionHelper sends committed composed text via setTimeout(0)
after compositionend, so the data can arrive AFTER a new compositionstart for
the next character has already fired. The previous suppression logic checked
isComposing with a 20ms post-compositionend window, which was too narrow and
the wrong signal — late-arriving composed text from the previous character was
dropped, causing characters to silently disappear during fast Korean typing.
Track expected post-composition data with a pendingComposedData counter that
is incremented on compositionend and consumed on the next data event,
regardless of isComposing state. A 500ms safety timeout decays the counter if
the expected data never arrives (e.g. cancelled/empty composition).
Also override the xterm composition view styling (which has a known position
TODO and uses hardcoded black/white at z-index 1) so users can actually see
the in-progress IME text. Themed to terminal colors with a clear border and
bumped z-index above other helpers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9cadde7 commit b5d72f5
2 files changed
Lines changed: 48 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
136 | 154 | | |
137 | 155 | | |
138 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| |||
313 | 318 | | |
314 | 319 | | |
315 | 320 | | |
| 321 | + | |
316 | 322 | | |
317 | 323 | | |
318 | 324 | | |
| |||
332 | 338 | | |
333 | 339 | | |
334 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
335 | 356 | | |
336 | 357 | | |
337 | 358 | | |
| |||
436 | 457 | | |
437 | 458 | | |
438 | 459 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
443 | 468 | | |
444 | 469 | | |
445 | | - | |
| 470 | + | |
446 | 471 | | |
447 | 472 | | |
448 | 473 | | |
| |||
0 commit comments