Vim/Neovim/tmux scroll way too fast with trackpads #8565

Closed
opened 2026-01-31 01:32:39 +00:00 by claunia · 11 comments
Owner

Originally created by @reissbaker on GitHub (May 25, 2020).

Originally assigned to: @DHowett on GitHub.

Environment

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.18362.0 Microsoft Windows NT 10.0.18362.0

Windows Terminal version 1.0.1401.0.

I'm curious whether or not this is trackpad-related, so FWIW I'm using a Surface Book and scrolling with the trackpad.

EDIT: I tried with a normal mouse plugged into the USB port instead of the trackpad, and it's definitely trackpad-related: regular mouse wheels work just fine.

Steps to reproduce

tmux set up with:

set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"	
bind -n WheelDownPane select-pane -t= \; send-keys -M

And/or Neovim (or just plain old Vim) with:

set mouse=a

Expected behavior

The above snippets make vim, nvim, and tmux able to be scrolled with the mouse/trackpad on macOS and Linux. They also work in WSL... If I use Xming to run an X server, and use urxvt as my terminal emulator. So, I'd expect that they'd also work for Windows Terminal.

They work in all of the above either alone (e.g. Vim/Neovim not nested inside tmux), or nested (e.g. running Neovim inside tmux).

Actual behavior

For some reason with the Windows Terminal, when I scroll in vim/nvim/tmux (with the editors either nested in tmux or un-nested) they all go absolutely nuts and scroll at like 10x speed, which is kind of unusable. FWIW I'm using a Surface Book and scrolling with my trackpad, if that makes a difference? It looks like it's just sending way more scroll events to the terminal than it should be.

Windows Terminal is otherwise dope and I'd love to be able to replace my janky Xming + urxvt setup for coding on Windows.

Here's a video I captured of the behavior in tmux — I tried to scroll a very small amount, and instead it scrolled 78 rows:

ezgif com-video-to-gif

Originally created by @reissbaker on GitHub (May 25, 2020). Originally assigned to: @DHowett on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0 ``` Windows Terminal version `1.0.1401.0`. I'm curious whether or not this is trackpad-related, so FWIW I'm using a Surface Book and scrolling with the trackpad. EDIT: I tried with a normal mouse plugged into the USB port instead of the trackpad, and it's definitely trackpad-related: regular mouse wheels work just fine. # Steps to reproduce `tmux` set up with: ```tmux set -g mouse on bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" bind -n WheelDownPane select-pane -t= \; send-keys -M ``` And/or Neovim (or just plain old Vim) with: ```vim set mouse=a ``` # Expected behavior The above snippets make `vim`, `nvim`, and `tmux` able to be scrolled with the mouse/trackpad on macOS and Linux. They also work in WSL... If I use Xming to run an X server, and use urxvt as my terminal emulator. So, I'd expect that they'd also work for Windows Terminal. They work in all of the above either alone (e.g. Vim/Neovim not nested inside `tmux`), or nested (e.g. running Neovim inside `tmux`). # Actual behavior For some reason with the Windows Terminal, when I scroll in vim/nvim/tmux (with the editors either nested in `tmux` or un-nested) they all go absolutely nuts and scroll at like 10x speed, which is kind of unusable. FWIW I'm using a Surface Book and scrolling with my trackpad, if that makes a difference? It looks like it's just sending way more scroll events to the terminal than it should be. Windows Terminal is otherwise dope and I'd love to be able to replace my janky Xming + urxvt setup for coding on Windows. Here's a video I captured of the behavior in `tmux` — I tried to scroll a very small amount, and instead it scrolled 78 rows: ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/803092/82804985-196aac80-9e38-11ea-8735-4dbda484a168.gif)
Author
Owner

@reissbaker commented on GitHub (May 25, 2020):

FWIW, I dug up a mouse I had lying around and tried scrolling with the mouse wheel. It worked perfectly, so I'm guessing this is an issue with trackpad support for scrolling in the Windows Terminal?

@reissbaker commented on GitHub (May 25, 2020): FWIW, I dug up a mouse I had lying around and tried scrolling with the mouse wheel. It worked perfectly, so I'm guessing this is an issue with trackpad support for scrolling in the Windows Terminal?
Author
Owner

@zadjii-msft commented on GitHub (May 26, 2020):

This seems just like the earlier issue we had where trackpads would scroll the Terminal buffer entirely too fast. I bet we're using the lines to scroll value from the system for scrolling the buffer, but not the VT mouse events we generate.

@zadjii-msft commented on GitHub (May 26, 2020): This seems just like the earlier issue we had where trackpads would scroll the Terminal buffer entirely too fast. I bet we're using the lines to scroll value from the system for scrolling the buffer, but not the VT mouse events we generate.
Author
Owner

@reissbaker commented on GitHub (May 27, 2020):

Makes sense. Thanks for the quick response! Looking forward to seeing this one close so I can switch over to using the Terminal.

@reissbaker commented on GitHub (May 27, 2020): Makes sense. Thanks for the quick response! Looking forward to seeing this one close so I can switch over to using the Terminal.
Author
Owner

@reissbaker commented on GitHub (Jul 8, 2020):

FWIW, this is somewhat worse with WSL2, since WSL2 broke (secure) X server communication from the Linux guest to the Windows host, and so it's unsafe to run Linux-based GUI terminals now.

I switched back to wsltty, but even that has some awkward scrolling bugs when used with trackpads (the beginning of the swipe up is treated as an up arrow, which cycles history in most shells). AFAICT there aren't any terminals on Windows anymore that work with WSL and trackpads.

@reissbaker commented on GitHub (Jul 8, 2020): FWIW, this is somewhat worse with WSL2, since WSL2 broke (secure) X server communication from the Linux guest to the Windows host, and so it's unsafe to run Linux-based GUI terminals now. I switched back to wsltty, but even that has some awkward scrolling bugs when used with trackpads (the beginning of the swipe up is treated as an up arrow, which cycles history in most shells). AFAICT there aren't any terminals on Windows anymore that work with WSL and trackpads.
Author
Owner

@DHowett commented on GitHub (Jul 9, 2020):

Alright, I’m taking this on. Gonna move delta accumulation into the shared mouse input code so both conhost and terminal benefit from it.

@DHowett commented on GitHub (Jul 9, 2020): Alright, I’m taking this on. Gonna move delta accumulation into the shared mouse input code so both conhost and terminal benefit from it.
Author
Owner

@DHowett commented on GitHub (Jul 10, 2020):

@reissbaker thanks for spurring us into action. 😄

@DHowett commented on GitHub (Jul 10, 2020): @reissbaker thanks for spurring us into action. :smile:
Author
Owner

@ghost commented on GitHub (Jul 21, 2020):

:tada:This issue was addressed in #6843, which has now been successfully released as Windows Terminal v1.1.2021.0.🎉

Handy links:

@ghost commented on GitHub (Jul 21, 2020): :tada:This issue was addressed in #6843, which has now been successfully released as `Windows Terminal v1.1.2021.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.1.2021.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Jul 22, 2020):

:tada:This issue was addressed in #6843, which has now been successfully released as Windows Terminal v1.1.2021.0.🎉

Handy links:

@ghost commented on GitHub (Jul 22, 2020): :tada:This issue was addressed in #6843, which has now been successfully released as `Windows Terminal v1.1.2021.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.1.2021.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Jul 22, 2020):

:tada:This issue was addressed in #6843, which has now been successfully released as Windows Terminal Preview v1.2.2022.0.🎉

Handy links:

@ghost commented on GitHub (Jul 22, 2020): :tada:This issue was addressed in #6843, which has now been successfully released as `Windows Terminal Preview v1.2.2022.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.2.2022.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@reissbaker commented on GitHub (Aug 3, 2020):

Yesssss thank you! 😁

Edit: tried out the Preview build, works perfectly!

@reissbaker commented on GitHub (Aug 3, 2020): Yesssss thank you! 😁 Edit: tried out the Preview build, works perfectly!
Author
Owner

@DHowett commented on GitHub (Aug 3, 2020):

Happy to hear it. Thanks for letting us know!

@DHowett commented on GitHub (Aug 3, 2020): Happy to hear it. Thanks for letting us know!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8565