Skip to content

fix(terminal): keep wheel scrolling inside terminal panes - #792

Open
Juliusolsson05 wants to merge 4 commits into
mainfrom
fix/terminal-wheel-boundary
Open

fix(terminal): keep wheel scrolling inside terminal panes#792
Juliusolsson05 wants to merge 4 commits into
mainfrom
fix/terminal-wheel-boundary

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Problem

At a scrollback boundary, xterm leaves the wheel event unconsumed and Chromium scrolls the surrounding native panel. This makes the inline terminal jump within DebugPanel. This is separate from the GPU glyph corruption repaired in #790.

Change

Attach a disposable bubbling wheel boundary to shell, agent, and inline-debug terminal hosts. Xterm gets first refusal for normal scrollback, alternate-screen arrows, and mouse reporting. Only an otherwise-unconsumed, unmodified vertical gesture has its browser default canceled. Horizontal/modifier gestures and application engagement propagation are preserved. No synthetic PTY input, viewport movement, React updates, or repaint loop is added.

Verification

  • 43 targeted tests pass across the boundary helper, all three mounted terminal lifetimes, retention, and GPU helper.
  • Main/renderer type-check and test-contract checks pass after integrating current main.
  • Real Electron/Chromium probe: node scripts/smoke-terminal-wheel.mjs passes; --control reproduces the original 120px parent-panel movement. Patched parent stays at 0px.
  • Both modes preserve normal scrollback, the viewed line during appended output, alternate-screen arrow input, and SGR mouse reports.
  • Clean diff check. Current-head CI passed (quality-gate and minimum-node-fixture-gate, run 33941434742).

Limits

This repairs the reproduced nested-scroll boundary leak; it does not claim to explain every reported scrolling symptom or change provider-specific alternate-screen behavior. The real-browser probe is opt-in because DOM test environments cannot exercise native default scrolling. The running application has not been restarted or changed by the probe.

Fixes #791

Let xterm consume normal scrollback and provider mouse input before canceling only unhandled vertical defaults on the host. This prevents inline terminal gestures from moving their surrounding panel without adding PTY, repaint, or React work. Preserve modified and horizontal gestures and dispose ownership on every host teardown.

Refs #791
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.

bug(terminal): wheel input escapes inline terminals at scrollback boundaries

1 participant