Scrollbar not working in terminal page #18767

Closed
opened 2026-01-31 06:23:42 +00:00 by claunia · 3 comments
Owner

Originally created by @h2cone on GitHub (Oct 28, 2022).

Description of the new feature/enhancement

20221028215213

I have made the Ubuntu scrollbar visible and it displays and scrolls normally in the terminal, but when viewing text files with less or more it doesn't scroll unless you use keyboard shortcuts to turn pages.

It would be more friendly for people who use mouse if the scrollbar was also available when using terminal pager.

Proposed technical implementation details (optional)

Make it so.

Originally created by @h2cone on GitHub (Oct 28, 2022). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> ![20221028215213](https://user-images.githubusercontent.com/24283234/198634945-e6303107-6827-421b-85c5-ef02141be6f5.png) I have made the Ubuntu scrollbar visible and it displays and scrolls normally in the terminal, but when viewing text files with `less` or `more` it doesn't scroll unless you use keyboard shortcuts to turn pages. It would be more friendly for people who use mouse if the scrollbar was also available when using terminal pager. # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. --> Make it so.
Author
Owner

@zadjii-msft commented on GitHub (Oct 28, 2022):

less is using the alternate screen buffer, a special terminal mode which disables the scrollback (scrollbar). I don't believe there's any way for an application to listen for "scrollbar input", either in the Console API or more traditional methods.

This would be a huge set of work across different terminal emulators and CLI applications:

  • CLI apps would need to be able to tell the terminal "I should have a scrollbar for N lines of output" when in the alt buffer.
  • CLI apps would need to be able to read "scrollbar events" on the input. What would those look like?
  • Once that's all built on the Terminal side, then less et. al. would need to implement support for these applications themselves.

@j4james correct me if I'm wrong, but there's nothing like this today, right?

@zadjii-msft commented on GitHub (Oct 28, 2022): `less` is using the alternate screen buffer, a special terminal mode which disables the scrollback (scrollbar). I don't believe there's any way for an application to listen for "scrollbar input", either in the Console API or more traditional methods. This would be a huge set of work across different terminal emulators and CLI applications: * CLI apps would need to be able to tell the terminal "I should have a scrollbar for N lines of output" when in the alt buffer. * CLI apps would need to be able to read "scrollbar events" on the input. What would those look like? * Once that's all built on the Terminal side, then `less` et. al. would need to implement support for these applications themselves. @j4james correct me if I'm wrong, but there's nothing like this today, right?
Author
Owner

@j4james commented on GitHub (Oct 28, 2022):

I don't know of any extensions for tracking scrollbar movement, but it might be possible to implement an app like that using the DEC windowing extension, since that lets you define a logical page size that is larger than the screen. So the app would set the size to however large their scroll area is, and the user would then be able to pan through that area with their terminal's scroll bar.

That said, it's unlikely any apps would attempt something like that, since hardly anyone supports that extension. Although I was hoping that we might implement it one day.

A more practical solution might be for us to create a kind of pseudo scrollbar whenever the alternate scroll mode is enabled. It wouldn't be able to represent the scroll position, or the size of the scroll area, but you could at least click the up and down buttons on the scroll bar, and possibly even trigger page jumps if you click near the top or bottom of the bar.

That seems a bit lame though, and might be more confusing than helpful. Just a thought.

@j4james commented on GitHub (Oct 28, 2022): I don't know of any extensions for tracking scrollbar movement, but it might be possible to implement an app like that using the DEC windowing extension, since that lets you define a logical page size that is larger than the screen. So the app would set the size to however large their scroll area is, and the user would then be able to pan through that area with their terminal's scroll bar. That said, it's unlikely any apps would attempt something like that, since hardly anyone supports that extension. Although I was hoping that we might implement it one day. A more practical solution might be for us to create a kind of pseudo scrollbar whenever the _alternate scroll_ mode is enabled. It wouldn't be able to represent the scroll position, or the size of the scroll area, but you could at least click the up and down buttons on the scroll bar, and possibly even trigger page jumps if you click near the top or bottom of the bar. That seems a bit lame though, and might be more confusing than helpful. Just a thought.
Author
Owner

@zadjii-msft commented on GitHub (Oct 31, 2022):

Yea, that's what I was feeling too. The pseudo-scrollbar isn't a terrible idea, but IMO it still really needs the page size (which we can't know) for users to really understand what's going on.

Honestly, I'm feeling like we should just reject this out. It's an interesting idea, but one better suited for terminal-wg than something we can just do ourselves.

@zadjii-msft commented on GitHub (Oct 31, 2022): Yea, that's what I was feeling too. The pseudo-scrollbar isn't a terrible idea, but IMO it still really needs the page size (which we can't know) for users to really understand what's going on. Honestly, I'm feeling like we should just reject this out. It's an interesting idea, but one better suited for [terminal-wg](https://gitlab.freedesktop.org/terminal-wg) than something we can just do ourselves.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18767