Skip to content

[Bug] Mouse wheel dead in the TUI inside the VS Code integrated terminal since 1.105, root cause is xterm not opencode #42501

Closed as not planned

Description

@Xukun-Liu

Description

The mouse wheel is dead in the TUI inside the VS Code integrated terminal. Arrow keys work, but scrolling the wheel does nothing. This started with VS Code 1.105.

The root cause is not opencode. The wheel events are silently swallowed by xterm.js, the terminal emulator bundled in VS Code, in the alt buffer. The regression was introduced in xterm 5.6.0-beta.119. I verified this with byte-level A/B testing between VS Code 1.104 (beta.118) and 1.105 (beta.119): a raw-mode pty listener plus CDP-injected wheel events. Pixel deltas under roughly 50px produce zero bytes on the pty, so the app never sees them. This affects trackpads, smooth wheels and low-sensitivity mice; fast-scrolling mice can pass the threshold, which is why it is so easy to miss.

Analysis and fix already submitted upstream:

Opening this here so opencode users hitting it in VS Code have a searchable reference, and a place to pick up the fix once VS Code ships a newer xterm.

Plugins

None

OpenCode version

Latest (dev build), run inside the VS Code integrated terminal

Steps to reproduce

  1. VS Code 1.105 or later on Windows, open the integrated terminal
  2. Start opencode (TUI)
  3. Hover the list and scroll the mouse wheel
  4. Trackpad / smooth wheel / low-sensitivity mouse: scroll does nothing

Screenshot and/or share link

Not applicable, see byte-level evidence in the linked xterm.js issue

Operating System

Windows 11

Terminal

VS Code integrated terminal (bundled xterm)

Activity

  1. github-actions commented on Aug 14, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The issue does not use one of the required issue templates (Bug Report, Feature Request, or Question). Please resubmit using the Bug Report template, which requires a Description field with content about the bug.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of or related to existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. Xukun-Liu commented on Aug 14, 2026

    @Xukun-Liu
    Author

    Updated the body to follow the Bug Report template (added a Description section). Requesting re-check of the compliance label.

  3. github-actions commented on Aug 14, 2026

    @github-actions
    Contributor

    Thanks for updating the issue to follow the Bug Report template! The issue now meets our contributing guidelines and the compliance flag has been removed. We appreciate the thorough investigation and upstream references.

  4. Xukun-Liu commented on Aug 14, 2026

    @Xukun-Liu
    Author

    One more thing that makes this fix necessary in practice: my company's intranet only provides older VS Code builds (upgrades are controlled by IT/security policy), and this bug affects every version from 1.105 onward, including those. So anyone stuck on an older VS Code in a locked-down environment has no way to get around the dead wheel in the TUI, no matter how many updates are released upstream. A fix in xterm is the only way it reaches these setups.

  5. Xukun-Liu commented on Aug 20, 2026

    @Xukun-Liu
    Author

    The xterm.js fix PR link above (#6104) died together with its head fork — it has been resubmitted as xtermjs/xterm.js#6118. Also reported directly to VS Code since the bundled xterm affects all integrated terminal users on 1.105+: microsoft/vscode#331756.

  6. Xukun-Liu commented on Oct 14, 2026

    @Xukun-Liu
    Author

    Status update: the upstream fix (xtermjs/xterm.js#6118) has been open for ~8 weeks without a review; a polite ping to the maintainers two weeks ago has also gone unanswered, and microsoft/vscode#331756 has been quiet as well.

    Since this is directly user-facing for opencode — every user on VS Code 1.105+ running a TUI in the integrated terminal has a dead mouse wheel — would the team be willing to leave a brief +1 or endorsement on the upstream PR? A signal from opencode carries much more weight with the xterm.js maintainers than the author pinging alone.

    The fix is fully verified (byte-level A/B across VS Code 1.104 / 1.105 / 1.128, 4 new unit tests, full suite green), and I'm happy to provide additional data if useful.

  7. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for tracing this to xterm.js in VS Code's integrated terminal: the affected wheel events are dropped before OpenCode receives them. Closing this as an upstream terminal issue; please follow xtermjs/xterm.js#6105 for updates.

  8. Xukun-Liu commented on Oct 20, 2026

    @Xukun-Liu
    Author

    Thanks for confirming the upstream attribution! For anyone following along: the fix is ready for review at xtermjs/xterm.js#6118 (byte-level A/B verification across VS Code 1.104/1.105/1.128, 4 new unit tests, full suite green). Once it lands and VS Code bundles the new xterm, the dead wheel in opencode's TUI resolves with no change needed on the opencode side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions