Skip to content

Fix terminal IME composition rendering below the cursor in Modern UI - #350140

Open
wonjang (wonjangcloud9) wants to merge 1 commit into
microsoft:mainfrom
wonjangcloud9:fix/modern-ui-terminal-ime-offset
Open

wonjang (wonjangcloud9) wants to merge 1 commit into
microsoft:mainfrom
wonjangcloud9:fix/modern-ui-terminal-ime-offset

Conversation

@wonjangcloud9

Copy link
Copy Markdown

Fixes #332671

With workbench.experimental.modernUI on, IME composition text in the integrated terminal (Korean 2-Set on macOS in the report) is drawn about half a row below the cursor.

Cause: #330685 gave the panel terminal's .xterm a top padding (padding-block: var(--vscode-spacing-size80)). It also set top: var(--vscode-spacing-size80) on .xterm .xterm-helpers. But xterm.js puts .xterm-helpers (the composition view and the helper textarea) inside .xterm-screen (CoreBrowserTerminal.ts: this.screenElement.appendChild(this._helperContainer)), and .xterm-screen is position: relative. So the helpers already move down with the padding, and the extra top moves them a second 8px. The composition view, and the textarea the OS IME candidate window is positioned from, end up 8px below the cursor row. The rows themselves are drawn in the right place.

Fix: remove that rule, so .xterm-helpers keeps top: 0 from terminal.css / xterm.css, relative to .xterm-screen.

Verification: I loaded the three stylesheets from main (xterm.css, terminal.css, modernUI/.../padding.css) into a page with the same structure: .modern-ui.monaco-workbench .part.panel .pane-body.integrated-terminal .xterm > .xterm-screen > .xterm-helpers > .composition-view. I set the composition view's top the way CompositionHelper does (cursor row × cell height) and measured it in headless Chrome:

cursor row top composition view top offset
main 50 58 8 px
this PR 50 50 0 px

The 8 px matches the report. I haven't run a full VS Code build with a real IME. Credit to seraph7942-art, who traced the same rule in anthropics/claude-code#97389 and posted a user-CSS workaround there.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 13:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the terminal IME alignment change, though validation with a real IME in VS Code is still outstanding.

No open issues 🎉

What changed in this PR

Fixes terminal IME composition alignment when Modern UI is enabled, addressing #332671 and the extra offset introduced by #330685.

Changes:

  • Removes the redundant top offset from .xterm-helpers, allowing composition text and the IME positioning textarea to align with the cursor.
  • Preserves the terminal’s existing vertical padding.

No actionable findings remain. The reported browser measurement confirms alignment, but validation with a real IME in VS Code is still outstanding.

File Description
src/​vs/​workbench/​contrib/​modernUI/​browser/​media/​padding.css Removes the Modern UI helper offset that displaced terminal IME composition.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

Korean IME composition text renders incorrectly in the integrated terminal when Modern UI is enabled

2 participants