Skip to content

Scrolling is too fast #795

@wch

Description

@wch

Issue summary

Scrolling with the touchpad or a mouse wheel is too fast. This makes it difficult to scroll a specific part of the history. I'm using a Mac, and this happens with both the touchpad and with a mouse scroll wheel, in Chrome, Firefox, and Safari.

This can be tested by going to https://jcubic.github.io/jquery.terminal/, holding down Enter until there are enough lines of output that a scrollbar appears, and then scrolling. The minimum scrolling increment for me is about 2 whole lines. In "normal" web content with a similar font size, the minimum scrolling increment is about 0.1-0.2 lines.

I found that replacing this:

if (delta > 0) {
self.scroll(-40);
} else {
self.scroll(40);
}

with this:

    self.scroll(-delta);

results in natural-feeling scrolling behavior, with proper acceleration.

Is there a particular reason that scrolling code sets the scrolling increment to 40?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugresolvedif issue is resolved, it will be open until merge with master

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions