From 2321929709ef5399642e033fd330c0fa9bbf0416 Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Wed, 18 Nov 2026 23:02:51 +0800 Subject: [PATCH] fix(terminal): keep the terminal from sliding sideways while composing (#4347) A TUI that leaves the cursor in the last column pushed xterm's input textarea and IME composition past the right edge, and Chromium (WebView2) scrolled the clipping pane to keep the caret visible. The xterm element now clips its overflow, so no ancestor can scroll. --- src/features/terminal/xtermInput.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/features/terminal/xtermInput.css b/src/features/terminal/xtermInput.css index f7d2c6db7..af0773ece 100644 --- a/src/features/terminal/xtermInput.css +++ b/src/features/terminal/xtermInput.css @@ -7,6 +7,14 @@ white-space: pre; } +/* xterm places its input textarea and IME composition at the cursor. A program that leaves the + cursor in the last column (pi, other TUIs drawing their own cursor) pushes them past the edge, + and Chromium (WebView2) then scrolls the clipping pane to keep the caret in view: the whole + terminal slides sideways while composing. `clip` keeps that overflow out of every ancestor. */ +.xterm { + overflow: clip; +} + /* An icon or fallback symbol wider than its cell stays over the next cell's background (domRowCache), while selected spans keep xterm's `.xterm-decoration-top` z-index (2). */ .xterm .xterm-rows .openidea-terminal-icon:not(.xterm-decoration-top) {