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

implement alternateScroll settings #5194

Open
CendioOssman opened this issue Oct 18, 2024 · 5 comments
Open

implement alternateScroll settings #5194

CendioOssman opened this issue Oct 18, 2024 · 5 comments
Labels
area/parser help wanted type/enhancement Features or improvements to existing features

Comments

@CendioOssman
Copy link

Details

  • VScode version: 1.93.1
  • OS version: RHEL 9

Steps to reproduce

  1. less file.txt
  2. Scroll mouse one click

Expected outcome

File scrolls the same 3 lines you get in the scrollback buffer, or as commonly seen in almost all other terminals.

Actual outcome

File scrolls a single line.

Additional details

If I do an strace of less, I can see the other terminals send three \33OB on one mouse scroll click, whilst xterm.js only sends the one. Which fully explains things.

I couldn't find any setting in vscode that affected this. Workarounds are welcome.

@CendioOssman
Copy link
Author

Note that it might be relevant if high-resolution scrolling is supported or not. I'm only seeing this in a VNC environment that only has the classical "stepped" wheel events.

@jerch
Copy link
Member

jerch commented Oct 19, 2024

Thats related to this line:

const sequence = C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? 'O' : '[') + (ev.deltaY < 0 ? 'A' : 'B');

As far as I can see with git blame, it has always been like that in the last 6 years.

File scrolls the same 3 lines you get in the scrollback buffer, or as commonly seen in almost all other terminals.

Which terminals show that behavior? (xterm does not on my system...)

@CendioOssman
Copy link
Author

As far as I can see with git blame, it has always been like that in the last 6 years.

That might very well be. I'm a new vscode user, so I'm comparing to other terminals, not to any previous xterm.js behaviour. :)

Which terminals show that behavior? (xterm does not on my system...)

Odd. I'm seeing it in xterm¹, GNOME terminal and MATE terminal (fork of GNOME 2 terminal). Tested on RHEL 9 and Fedora 40.

Three lines is also what xterm.js scrolls per click for me in the "normal" scrollback, so it's a bit confusing when the scroll distance changes when I open a less.

¹ xterm actually jumps 5 lines for me, not 3

@CendioOssman
Copy link
Author

Perhaps that sequence should be multiplied by the various settings affecting the scrollback, so they stay in sync?

@jerch
Copy link
Member

jerch commented Oct 22, 2024

I checked the xterm sources - thats basically linked there to alternateScroll or DECSET 1007. For some reason thats disabled on my system (ubuntu here).

Perhaps that sequence should be multiplied by the various settings affecting the scrollback, so they stay in sync?

I agree, we should strive to sync that with other scroll handling like on the normal scroll buffer.

So what we need here:

  • implement a alternateScroll private toggling that scrolling on/off
  • implement DECSET/DECRST 1007 on top
  • put a default for it into terminal options
  • sync scroll width with other scroll handling

@jerch jerch added help wanted area/parser type/enhancement Features or improvements to existing features and removed needs more info labels Oct 22, 2024
@jerch jerch changed the title Scroll in "less" only jumps a single line implement alternateScroll settings Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/parser help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

No branches or pull requests

2 participants