Skip to content

CJK characters typed after a Space are invisible in the prompt until selected or submitted #3654

@ds-damonzh

Description

@ds-damonzh

Describe the bug

Since approximately v1.0.55 (when the cell-based terminal renderer was enabled by default), Chinese characters typed immediately after pressing Space are invisible in the input prompt. The correct 2-cell placeholder width is reserved (cursor advances normally), but the glyphs are not rendered. The characters become visible after either:

  • Selecting them with the mouse, or
  • Pressing Enter to submit

Affected version

1.0.59

Steps to reproduce the behavior

  1. Open Copilot CLI
  2. Type anything into the prompt, then press Space
  3. Switch to Chinese Pinyin IME and type a Chinese character
  4. Observe: the Chinese character is not visible, but the cursor has advanced by 2 cells (correct width reserved)
  5. Select the invisible area with mouse → character appears
  6. Alternatively, press Enter → character appears before submission

Environment:

  • Copilot CLI version: 1.0.59
  • OS: macOS (Darwin arm64 / Apple Silicon)
  • Terminal: Ghostty (xterm-ghostty)
  • Input Method: macOS Chinese Pinyin IME
  • LANG: en_SG.UTF-8

Likely root cause: The cell-based terminal renderer introduced in v1.0.55 fails to repaint 2-cell-wide CJK glyphs when they are typed immediately following a Space character, leaving the cell slots blank until a repaint is forced.

Expected behavior

Chinese characters should be visible as they are typed.

Additional context

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:input-keyboardKeyboard shortcuts, keybindings, copy/paste, clipboard, mouse, and text inputarea:terminal-renderingDisplay and rendering: flickering, scrolling, line wrapping, output formatting

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions