Skip to content

Conversation

@notxx
Copy link

@notxx notxx commented Jan 19, 2026

When the cursor is at the right-most column and IME composition text is long, the composition-view element can extend beyond the terminal boundary, causing the container to stretch horizontally.

This fix adds two layers of protection:

  1. CSS: Add overflow: hidden to .xterm and .xterm .xterm-screen to prevent container stretching by internal elements.

  2. Core logic: Enhance CompositionHelper.updateCompositionElements() to detect when the composition view would overflow the terminal width. When overflow is detected, the composition view is moved left and down one line to keep it within bounds, while maintaining IME candidate window alignment.

The fix includes unit tests to verify the overflow detection and position correction behavior.

Fixes #5454
Related to microsoft/vscode#282621

notxx and others added 4 commits January 19, 2026 20:02
Prevent composition-view from extending beyond terminal boundary when
cursor is at the right-most column. Add CSS overflow: hidden guardrail
and enhance updateCompositionElements() to detect and correct overflow
by repositioning the composition view left and down one line.

Includes unit tests for overflow detection and position correction.

Fixes xtermjs#5454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chinese IME shows input far from cursor when using AI CLIs

1 participant