fix(terminal): hide scrollbar and stop stale-frame wheel scroll for TUI tools
The web terminal only hosts full-screen TUI tools (pi-agent, opencode), which repaint in place in the normal buffer and do not use the alternate screen or mouse tracking. With scrollback enabled, every repaint accumulated as history, so xterm's viewport scrollbar appeared and the mouse-wheel scrolled through stale frames instead of interacting with the app; the scrollbar column also perturbed FitAddon's column count. - terminal.tsx: set scrollback:0 and scrollSensitivity/fastScrollSensitivity:0 so only the live viewport is kept (no bar, no stale-frame wheel jank). - utilities.css: hide .xterm-viewport scrollbar (scrollbar-width:none + ::-webkit-scrollbar display:none) as belt-and-suspenders. Wheel no longer scrolls stale frames; in-app scrolling uses the tool's own keys. Headquarter-only change; no tool is touched.
This commit is contained in:
@@ -276,10 +276,17 @@ export const TerminalComponent = React.forwardRef<TerminalRef, TerminalProps>(
|
||||
lineHeight: 1.2,
|
||||
letterSpacing: 0,
|
||||
allowTransparency: false,
|
||||
scrollback: 10000,
|
||||
// This terminal only ever hosts full-screen TUI tools (pi-agent,
|
||||
// opencode), which repaint in place in the normal buffer and do not
|
||||
// use the alternate screen or mouse tracking. With scrollback, every
|
||||
// repaint accumulates as history → a viewport scrollbar appears and
|
||||
// the mouse-wheel scrolls through stale frames instead of the app.
|
||||
// scrollback:0 keeps only the live viewport: no bar, no stale-frame
|
||||
// wheel jank. (Scrollbar is also hidden via CSS for belt-and-suspenders.)
|
||||
scrollback: 0,
|
||||
ignoreBracketedPasteMode: false,
|
||||
fastScrollSensitivity: 5,
|
||||
scrollSensitivity: 1,
|
||||
fastScrollSensitivity: 0,
|
||||
scrollSensitivity: 0,
|
||||
smoothScrollDuration: 0,
|
||||
theme: {
|
||||
background: "#1e1e1e",
|
||||
|
||||
@@ -938,6 +938,14 @@ a.nav-item,
|
||||
overscroll-behavior: auto;
|
||||
max-height: 100% !important;
|
||||
width: 100% !important;
|
||||
/* Full-screen TUI tools repaint in place; scrollback is 0 (see terminal.tsx).
|
||||
Hide the viewport scrollbar so it never appears or captures input. */
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
}
|
||||
|
||||
.terminal-container .xterm-viewport::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* On mobile the custom touch handler scrolls the buffer; disable native
|
||||
|
||||
Reference in New Issue
Block a user