microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.4k stars 8.3k forks source link

Mouse tracking does not respect the system's `rows to scroll` setting #18102

Open o-sdn-o opened 3 hours ago

o-sdn-o commented 3 hours ago

Windows Terminal version

current main

Windows build number

10.0.19045.4894

Other Software

WSL + vim

Steps to reproduce

  1. Set the rows to scroll system setting to 5.
  2. Run
    wsl bash -c "vim -c :h"
  3. Scroll the mouse wheel.

Type :q and press Enter (repeat twice) to quit.

Expected Behavior

The cursor should move at the pace specified in the system-wide settings - 5 rows per 1 wheel step.

https://github.com/user-attachments/assets/81ccadb8-454c-44a9-bff6-9a046c0ab1d8

Actual Behavior

The cursor moves at a speed of one row per mouse wheel step.

https://github.com/user-attachments/assets/aad547ef-c99d-4b32-9002-b35f26091c63

zadjii-msft commented 3 hours ago

I'm surprised that this wasn't already somewhere on our backlog! I could have swore I remembered a discussion about this already, but I sure can't find it. Thanks for filing!

lhecker commented 2 hours ago

I thought that when mouse tracking is enabled, the terminal only sends a single sequence per scroll event. Isn't sending of multiple cursor up/down sequences only a thing during the alternate scroll mode with mouse tracking disabled?

DHowett commented 1 hour ago

Yes, this should be the case. Xterm mouse reporting reports button events, of which each wheel detent is one.

Xterm mouse reporting does not report lines scrolled.

How many lines the application scrolls when it receives a wheel detent button reports an application choice.

We can choose to treat ASB with Alternate Scroll differently, but I am not interested in changing how wheel detents are reported.

zadjii-msft commented 36 minutes ago

I assumed that this was alternate scroll mode in action, fwiw.

DHowett commented 31 minutes ago

Hm. I expect vim to use xterm mouse reporting.

It does here:

Image