zed icon indicating copy to clipboard operation
zed copied to clipboard

Scroll speed in tmux in terminal emulator is way too fast

Open fasterthanlime opened this issue 1 year ago • 4 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When using the mouse wheel / trackpad to scroll up and down in the terminal in a tmux session with mouse mode enabled, scroll speed is way too fast, compared to a terminal emulator like WezTerm.

Environment

Zed: v0.156.0 (Zed Preview) OS: macOS 15.0.1 Memory: 8 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Compare and contrast — same tmux session, from WezTerm (reasonable scroll speed) then Zed (way too fast):

https://github.com/user-attachments/assets/81a47933-1692-4007-801d-f7ec4d9454bd

If applicable, attach your Zed.log file to this issue.

Zed.log

fasterthanlime avatar Oct 09 '24 16:10 fasterthanlime

Does this happen in alacritty too? Zed uses alacritty as an underlying terminal library, so it might be an issue with its implementation or with our usage

Edit: I've tested this and the bug is not present in alacritty

WeetHet avatar Oct 09 '24 17:10 WeetHet

Alacritty seems to behave okay here:

https://github.com/user-attachments/assets/2eb6a214-e650-4f9b-af8c-c3dc1ead351c

fasterthanlime avatar Oct 09 '24 17:10 fasterthanlime

I have enabled Alternate Scroll Mode with "terminal": { "alternate_scroll": "on" } in my settings and can't reproduce what you're seeing where it jumps 5 rows at a time.

https://github.com/user-attachments/assets/6aaf5140-59a4-4ce1-9823-7026e75a5888

I've tested with:

  • Logitech M575 Trackball scrollwheel
  • Apple Magic Trackpad 2
  • Apple Magic Mouse 2

In System Preferences->Pointer Control I have the Scroll Speed set to 5/8 for the Trackpad Options and 3/8 for the mouse options, but those does not appear to impact the behavior of Zed.

Steps I used to reproduce: run tmux, then for i in {1..10000}; do echo $i; done Enter the scroll buffer with ctrl-b [ and scroll away. (q to quit scroll mode)

notpeter avatar Oct 09 '24 19:10 notpeter

I've turned Alternate Scroll mode on and it does not seem to solve this problem, so it must be something else. I've looked into what events we are sending to alacritty, and so far was able to determine that for a scroll up we are sending sgr_mouse_report(..., 64, false) once, which indeed corresponds to scrolling up by one line, and is seemingly the same as alacritty

Also, this is not a tmux-specific bug, as zellij has the same problem when scrolling

WeetHet avatar Oct 09 '24 19:10 WeetHet

Not stale

WeetHet avatar Mar 18 '25 15:03 WeetHet

The same issue happens also when opening zellij in zed terminal.

I use it in zed remote environment to have long running sessions. the scrolling in zed terminal is smooth. but once in tmux or zellij it is per scroll-tick 5 lines.

any ideas?

yannickschuchmann avatar Sep 22 '25 18:09 yannickschuchmann