microsoft / microsoft/vscode

Terminal: mouse wheel dead in full-screen TUI apps (alt buffer) since 1.105 — regression in bundled xterm.js

Open
#331,756 0 comments 0 reactions 1 assignee Claimed by @anthonykim1 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Description

Since VS Code 1.105, the mouse wheel does nothing for full-screen TUI apps (vim, less, htop, etc.) running in the integrated terminal when the app switches to the alternate screen buffer. Arrow keys still work; only the wheel is dead. Fast-scrolling mice mostly still work (their deltas are large enough), which hides the bug from many users — trackpads, smooth wheels and low-sensitivity mice are the most affected.

### Root cause (verified, upstream in xterm.js)

Regression introduced in xterm.js 5.6.0-beta.119: the alt-buffer wheel handler now gates on `consumeWheelEvent()` returning a non-zero amount and silently drops the event when the pixel delta dampens/floors to zero lines (any single delta below roughly one cell height; also swallows shift+wheel entirely). The gate is leftover from the old line-scrolling implementation — this path always sends exactly one ESC[A/ESC[B regardless of the returned amount.

- Root cause analysis with byte-level evidence: https://github.com/xtermjs/xterm.js/issues/6105
- Fix PR (includes 4 new unit tests, full suite passes): https://github.com/xtermjs/xterm.js/pull/6118

Verified byte-level with a raw-mode pty listener in the alt screen + CDP-injected wheel events against VS Code 1.104 (xterm 5.6.0-beta.118, works), 1.105 (5.6.0-beta.119, broken) and 1.128.0 (xterm 6.1.0-beta.288, still broken — i.e. current stable): on 1.105+ all pixel deltas under ~50px produce 0 bytes on the pty, so the app never sees the scroll. The gate lives in platform-independent browser code, so this likely affects all platforms; verified on Windows 11.

### Steps to Reproduce

1. VS Code 1.105 or later on Windows, open the integrated terminal
2. Start a full-screen TUI app that uses the alt buffer (e.g. `vim`, or `less` on a long file)
3. Hover the app area and scroll the mouse wheel
4. Trackpad / smooth wheel / low-sensitivity mouse: nothing happens (arrow keys still work)

### Expected behavior

The app receives the scroll (one ESC[A/ESC[B per wheel event), same as VS Code 1.104.

### VS Code Version

1.105.1 (first broken) — still broken in 1.128.0 (current stable)

### OS and Terminal

Windows 11, integrated terminal (bundled xterm.js)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.