It would be great if a virtual scroll bar was provided.
The terminal scrolling definitely needs an enhancement and physical scrolling with a scrollbar would be a great addition. The only tricky thing to do there is handling switching back and forth with curses applications like Vim.
hterm handles the scrollbar really well but only has the currently displayed viewport in the DOM. We should see how they implement it.
I'm going to work on this as part of vscode 1.5.0, the current rough plan/approach is:
height and line-height explicitly on .xterm-rows (will resolve #149).xterm-rows in a .xterm-viewport element which has overflow-y: scroll.xterm-scroll-area element which sizes based on the total number of rows in the buffer, this will be invisible but will position itself based on y, ybase and ydispSounds 馃憤 . What is the purpose of .xterm-scroll-area element though? Will it be used for the displaying of the scroll bar?
@parisk yes, it's a large element that's programmatically sized and is used for the scrollbar. After playing with this implementation I ended up getting it working but needed to pull .xterm-rows out of .xterm-viewport, otherwise every refresh would recall the scroll method. That made it very difficult to handle the 3 scroll cases; wheel, drag and drop scroll bar and up/down arrows.
I'll probably put out a PR later today.
Most helpful comment
@parisk yes, it's a large element that's programmatically sized and is used for the scrollbar. After playing with this implementation I ended up getting it working but needed to pull
.xterm-rowsout of.xterm-viewport, otherwise every refresh would recall the scroll method. That made it very difficult to handle the 3 scroll cases; wheel, drag and drop scroll bar and up/down arrows.I'll probably put out a PR later today.