Xterm.js: Magic mouse scroll inside tmux is extremely sensitive

Created on 26 Oct 2017  路  9Comments  路  Source: xtermjs/xterm.js

Details

  • Browser and browser version: VS Code
  • OS version: macOS
  • xterm.js version: Tyriar/xterm.js#vscode-release/1.18

Steps to reproduce

  1. Use an Apple Magic Mouse
  2. Run tmux with mouse support
  3. Run a command with lots of output
  4. Try to scroll

The scrolling has become really really sensitive. It's been like this for a while, can't really pinpoint the change point.

Most helpful comment

Oh... Sorry about that, I could've sworn it was a regression. D'oh!

Thanks for the pointer!

Another one: http://www.davidverhasselt.com/better-mouse-scrolling-in-tmux/

All 9 comments

I don't think anything has changed for a long time with scrolling. You didn't change your OS sensitivity settings did you? I would think I could repro with just a trackpad on macOS.

Also are you on High Sierra?

Just regular settings. It repros on the magic trackpad too. I am, but it also repro'd before updating.

Doesn't happen to you?

Everything works fine for me. I'm on a mid-2014 macbook, not sure if that is sufficiently magical.

I can reproduce it here, scrolling with the built-in touchpad of my MacBook Pro (Retina, 15-inch, Late 2013) on High Sierra does make it scroll quite a lot, even when scrolling very slowly. For exampling, scrolling one notch with the mouse wheel will make it scroll one line, but scrolling very slowly with the touchpad will make it scroll at least 5 lines. Interestingly, this behaviour can only be observed in tmux, while scrolling the normal terminal buffer outside of tmux seems to work very well. Almost looks like we already throttle the scroll when scrolling our viewport, but we send the raw scroll events if mouse support is enabled by an application like tmux.

Yes, scrolling while mouseEvents are enabled will send the raw, unthrottled scroll data:

https://github.com/sourcelair/xterm.js/blob/2e8410da4bf4ccc44b7277ec22a0d473565c9d13/src/Terminal.ts#L982-L995

Oh, that makes a lot more sense if it only applies with mouse events enabled, doh. That uses a separate mechanism for scrolling.

Can reproduce now:

  • Scroll up sends: \x1b[<64;77;21M
  • Scroll down sends: \x1b[<65;58;17M

It's using sgrMouse mode.

This is not a regression, it happens in VS Code 1.15 too as well as gnome-terminal, terminator and Terminal.app. Looks like this is just a tmux thing as it defaults to 5 lines scrolled per scroll wheel event.

Configure using something like this: https://stackoverflow.com/a/37370713/1156119

Oh... Sorry about that, I could've sworn it was a regression. D'oh!

Thanks for the pointer!

Another one: http://www.davidverhasselt.com/better-mouse-scrolling-in-tmux/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabiospampinato picture fabiospampinato  路  4Comments

Tyriar picture Tyriar  路  4Comments

johnpoth picture johnpoth  路  3Comments

7PH picture 7PH  路  4Comments

chris-tse picture chris-tse  路  4Comments