xterm.js
xterm.js copied to clipboard
onScroll event does not get fired on user scroll
The documentation states that onScroll gets fired when the viewport's scroll position changes which is not true. This event is only fired when new lines are introduced.
Is it fixed?
I think there is still that misconception at work here - onScroll
was initially meant to indicate line scrolling in the terminal buffer, thus when the cursor addressable area gets moved. This is only partially linked to viewport scrolling in the case, that both happen together. Isolated viewport scrolling without any change on the terminal buffer is not handled by that.
I am not sure if we should fuse buffer scrolling and viewport scrolling any further into one event, they are really 2 different things for the terminal. From a technical viewpoint a separate onViewportScroll
event makes more sense, which we dont have atm. @Tyriar Imho we already had several issues for that, but cant find them atm.
Just to confirm this is still an issue in v5.4.0-beta.20.
I'll also just add a reference to the origin of this issue, where @Tyriar asked for a new thread to be made: https://github.com/xtermjs/xterm.js/pull/3205#issuecomment-1157774699
Any update for this issue? My case is scroll top to load more data, I think it's a very command case. Do we have any workaround for this?
@McDaddy Here is my workaround:
https://github.com/tabarra/txAdmin/blob/v7.0.0/panel/src/pages/LiveConsole/ScrollDownAddon.ts