Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smooth pixel-based scrolling #27583

Closed
NeilGirdhar opened this issue Feb 22, 2024 · 10 comments
Closed

Smooth pixel-based scrolling #27583

NeilGirdhar opened this issue Feb 22, 2024 · 10 comments
Labels
enhancement feature request status:blocked-external Needs a third-party / external change or fix tui

Comments

@NeilGirdhar
Copy link

Problem

Some terminals (like Sakura) support smooth pixel-based scrolling. Kitty may soon support it too: kovidgoyal/kitty#1454

Expected behavior

It would be amazing if Neovim could work with the terminal so that this occurs whenever a command scrolls, e.g.,

  • ctrl-d, ctrl-u (page down and up),
  • zz (rehome)
  • etc.

I've noticed that the Kitty creator has in various other threads been open to providing the necessary interface for working with various applications. So I think you could get buy-in from the terminal.

This would be a huge visual improvement for NeoVim over other text editors 😄

@bfredl
Copy link
Member

bfredl commented Feb 22, 2024

Is there a quick reference for exactly what escape sequences Neovim TUI need to emit in order for this to happen?

@clason
Copy link
Member

clason commented Feb 22, 2024

Let's wait for a standard protocol.

(Also, your "may support soon" is doing a lot of heavy lifting here -- to the point of being misleading, as this PR has been long stalled. This doesn't help your point.)

@zeertzjq zeertzjq added status:blocked-external Needs a third-party / external change or fix tui labels Feb 22, 2024
@syyyr
Copy link

syyyr commented Feb 22, 2024

I think the "smooth scrolling" mentioned in the kitty PR refers to the ability of the terminal to react to touchpad scroll events by the pixel instead of interpreting a certain distance scrolled as mouse scroll wheel events. This is already supported in other terminals and has nothing to do with neovim, it's about how the terminal interprets mouse events.

@zeertzjq
Copy link
Member

I've noticed that the Kitty creator has in various other threads been open to providing the necessary interface for working with various applications.

What threads? What interface?

@clason clason added the needs:response waiting for reply from the author label Feb 22, 2024
@NeilGirdhar
Copy link
Author

Is there a quick reference for exactly what escape sequences Neovim TUI need to emit in order for this to happen?

AFAIK they don't exist yet 😄

Let's wait for a standard protocol.

Fair enough. But the motivation to create a standard protocol comes from potential users. Just a show of interest on the NeoVim side might be helpful?

(Also, your "may support soon" is doing a lot of heavy lifting here -- to the point of being misleading, as this PR has been long stalled. This doesn't help your point.)

Sorry I wasn't trying to mislead anyone. Maybe I'm a bit too optimistic.

tty PR refers to the ability of the terminal to react to touchpad scroll events by the pixel instead of interpreting a certain distance scrolled as mouse scroll wheel events.

The vim use-case is mentioned in the comments. The touchpad scrolling is simply another use case. There are multiple use-cases for that feature.

What threads? What interface?

I just read a bunch of threads recently. I think it was in some long discussion with the vim people regarding some terminal-vim interaction weirdness. He seemed quite open to creating various protocols to suit vim's needs.

@github-actions github-actions bot removed the needs:response waiting for reply from the author label Feb 22, 2024
@syyyr
Copy link

syyyr commented Feb 23, 2024

What I meant to say is that there's nothing that needs to be done from neovim's side - sure, scrolling in neovim is a usecase, but if neovim doesn't have to implement anything, why open an issue here?

@alba4k
Copy link

alba4k commented Feb 23, 2024

The pr you mention for kitty is 5 years old...

@zeertzjq
Copy link
Member

I can see that something may indeed need to be done on Nvim's side if such a protocol exists: for smooth scrolling, it's necessary to send off-screen content to the terminal before sending scroll events.

@syyyr
Copy link

syyyr commented Feb 23, 2024

I guess pixel based scrolling also means the ability to basically only show a part of some line. Indeed, neovim would have add some support for this. It looks to me that the PR implements both of the "meanings", and that's why I was confused.

Edit: actually I'm probably just completely wrong about all of this. Sorry

@clason
Copy link
Member

clason commented Feb 23, 2024

This is indeed too optimistic. Please open a new issue if and when a standard protocol is available we can consider implementing. Otherwise this is a generic and unactionable "letter to Santa" that just clutters the issue tracker.

@clason clason closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request status:blocked-external Needs a third-party / external change or fix tui
Projects
None yet
Development

No branches or pull requests

6 participants