Skip to content

Add horizontal scrolling with mouse wheel in some terminals#766

Open
g-dg wants to merge 1 commit intomicrosoft:mainfrom
g-dg:horizontal_mouse_scroll
Open

Add horizontal scrolling with mouse wheel in some terminals#766
g-dg wants to merge 1 commit intomicrosoft:mainfrom
g-dg:horizontal_mouse_scroll

Conversation

@g-dg
Copy link

@g-dg g-dg commented Feb 19, 2026

This PR adds the ability to horizontally scroll in some terminals by either using the horizontal scroll wheel, or by holding the shift key and scrolling with the vertical scroll wheel.

Tested on:

  • Windows (Windows 11)
    • Windows Terminal - doesn't send escape codes for horizontal scrolling or shift-vertical scrolling
    • Windows Console Host - doesn't send escape codes for horizontal scrolling or shift-vertical scrolling
    • mintty - horizontal scroll works, shift-vertical scrolling seems to move the cursor up and down (???)
  • Linux (Arch Linux with KDE on Wayland)
    • VSCode integrated terminal - doesn't send escape codes for horizontal scrolling or shift-vertical scrolling
    • Alacritty - works
    • Ghostty - works (scrolls very fast with precision scrolling, but this seems to also be a problem in other command-line utilities that support mouse scrolling)
    • GNOME Console - works
    • GNOME Terminal - works
    • kitty - works
    • Konsole - doesn't differentiate between vertical scrolling and vertical scrolling while holding shift
    • XTerm - works for horizontal scroll wheel, doesn't send escape codes for shift-vertical scrolling

Not tested on:

  • Mac OS

I didn't try any other terminal mouse tracking modes. For all I know, there may be one that gets more terminals to work, but changing it will probably mess up a whole bunch of other stuff.

Scrolling horizontally by 7 characters seems to be about the same as what VSCode does. I wouldn't mind other people's opinions on this though.

Cool project, BTW.

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.

1 participant

Comments