Skip to content

Korean IME (v1.24+): Composing character visually hides the character to its right #20040

@drvoss

Description

@drvoss

Windows Terminal version

Affected: v1.24.10621.0 and later
Not affected: v1.23.20211.0 and earlier

Input method

Microsoft Korean IME (Dubeolsik or Sebeolsik layout)

Steps to reproduce

  1. Open Windows Terminal with any shell.
  2. Switch input method to Korean IME.
  3. Type rk then sk to produce 가나.
  4. Move the cursor between and (press Left once).
  5. Type e to begin composing .

Expected behavior

Display shows 가ㄷ나 — the in-progress composition appears as an insertion, and remains visible.

Actual behavior

Display shows 가ㄷ is visually hidden for the entire duration of the composition. It reappears only after the syllable is committed.

Root cause

Renderer::_PaintBufferOutput writes the tsfPreview overlay using ReplaceText (overwrite-style) at the cursor column. The original row is saved in scratch but the displaced character to the right of the cursor is never restored visually for the duration of the frame.

This regression was introduced by #19738, which caused the Korean IME to use TSF inline rendering for the first time (previously it used IMM32 with a floating composition window).

Proposed fix

After writing the composition text, walk the original row (scratch) from the cursor position, absorbing up to W whitespace columns (where W = composition width), and copying non-whitespace glyphs to the right of the composition text. This renders the composition as an insertion while preserving TUI box borders when trailing whitespace is available.

A fix is ready on: https://github.com/drvoss/terminal/tree/fix/korean-ime-composition-insert-rendering

This is a companion to #20038.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-InputRelated to input processing (key presses, mouse, etc.)Help WantedWe encourage anyone to jump in on these.Issue-BugIt either shouldn't be doing this or needs an investigation.Product-ConhostFor issues in the Console codebaseProduct-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    Status

    To Cherry Pick

    Status

    To Cherry Pick

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions