Skip to content

[Bug] Chinese IME composition text overflows terminal horizontally; candidate window jumps to far right (upstream xterm.js 6.0.0) #3435

Description

@hupeak

Environment

  • Wave Terminal: v0.14.5 (w2), Windows
  • Bundled dependency: @xterm/xterm ^6.0.0 (confirmed in package.json)
  • IME: Microsoft Pinyin / Sogou (reproducible with any caret-following Chinese IME)

Steps to reproduce

  1. Open a terminal block in Wave.
  2. Move the cursor toward the right side of the terminal (or just start typing near the end of a line).
  3. Type Chinese with an IME so a composition (preedit) string appears.

Actual behavior

  • The terminal view expands horizontally / shows horizontal overflow while composing.
  • The IME candidate window is anchored to the far right of the terminal, far away from the cursor.

Expected behavior

  • The composition (preedit) text is clipped at the terminal's right edge and never widens the layout.
  • The IME candidate window stays near the cursor.

Root cause (upstream xterm.js, already confirmed & fixed but unreleased)

xterm.js renders IME composition text in an overlay .composition-view that is position:absolute; white-space:nowrap with no max-width / overflow limit. When the cursor is near the right edge, the composition text extends rightward past the terminal boundary and stretches the container. The hidden helper textarea's width is synced to the composition view's width, so the caret — and therefore the IME candidate window — is pushed to the far right.

This is exactly the upstream bug:

Note

Wave's AI chat block is NOT affected — it uses a native DOM input, not the xterm.js composition layer, which confirms the bug lives in the xterm.js terminal component.

Suggested fix

  • Bump @xterm/xterm to a release containing #5747 (7.0.0 or a backport), or
  • Backport the composition-view clipping (max-width + overflow: hidden, matching ghostty behavior) into Wave's bundled xterm.css.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions