fix: don't swallow wheel events in the alt buffer when consumeWheelEvent() returns 0 - #6118
Open
Xukun-Liu wants to merge 1 commit into
Open
fix: don't swallow wheel events in the alt buffer when consumeWheelEvent() returns 0#6118Xukun-Liu wants to merge 1 commit into
Xukun-Liu wants to merge 1 commit into
Conversation
…returns 0 Wheel events in the alternate screen (no scrollback) are converted into a single up/down sequence so full-screen TUI apps can scroll. Since 5.6.0-beta.119 this path is gated on consumeWheelEvent() returning a non-zero amount, which silently drops the event when the pixel delta dampens and floors to zero lines (|deltaY| < ~50px on typical setups), when shift is held, or when renderer dims are not ready yet. The magnitude is never used by this path - the sequence sent is always exactly one ESC[A/ESC[B - so the gate is purely destructive and contradicts the comment above it. Keep the call to sync the partial scroll accumulator for the wheel-scroll option, but don't gate on it. Byte-level A/B evidence (VS Code 1.104 beta.118 vs 1.105 beta.119, instrumented bundle + raw-mode pty listener in the alt screen): 1.104 sends one ESC[B for every probe; 1.105 swallows all pixel probes below ~50px while line-mode and large deltas pass.
This was referenced Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since 5.6.0-beta.119 the alt-buffer wheel handler gates on
consumeWheelEvent()returning a non-zero amount, and drops the event when it rounds to zero. That kills the wheel for full-screen TUI apps on trackpads, smooth wheels and low-sensitivity scroll settings: any single pixel delta below roughly one cell height gets dampened, floored to 0, and never reaches the app. It also swallows shift+wheel entirely.The sequence this path sends is always exactly one ESC[A/ESC[B, the return value is only used as a boolean, and the comment above the code already states the behavior is "simply send a single up or down sequence". So the gate is leftover from the old line-scrolling implementation and has nothing to gain here.
This keeps the
consumeWheelEvent()call so the partial-scroll accumulator stays in sync, but onlydeltaY === 0skips sending.Fixes #6105 (resubmit of #6104, which was closed when its head repository was removed).
Verification
Byte-level A/B between VS Code 1.104 (xterm 5.6.0-beta.118) and 1.105 (5.6.0-beta.119): raw-mode pty listener in the alt screen, instrumented bundle logging
consumeWheelEvent()input and result per event.1.104 sent one ESC[B for every probe, 1.105 dropped all pixel probes under 50px (0 bytes on the pty) while line-mode and large deltas passed. Renderer dims were healthy in both runs, so the failures are the dampening path, not a sizing race.
Also re-verified on the current stable release, VS Code 1.128.0 (ships xterm 6.1.0-beta.288), same setup: pixel deltas below the threshold still produce 0 bytes on the pty, line-mode and large deltas pass. The regression is live in the release most users run today.
Tests: 4 new unit cases (small pixel delta, negative delta, zero delta, app-handles-wheel-itself). Full unit suite passes (2342 tests), lint clean.