-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow markers on the alt buffer #3924
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One special thing that comes to mind here is for alt buffers we want to dispose all buffers as soon as the active buffer switches back to the normal buffer. I think the fix for that would be to call clearAllMarkers()
here:
xterm.js/src/common/buffer/BufferSet.ts
Lines 83 to 86 in 055bcce
// The alt buffer should always be cleared when we switch to the normal | |
// buffer. This frees up memory since the alt buffer should always be new | |
// when activated. | |
this._alt.clear(); |
Without clearAllMarkers, you can see that the alt buffer decorations persist on the screen until the normal buffer is rendered. The search addon disposes the decorations/markers then on the onWriteParsed() event. Adding clearAllMarkers disposes them before clearing the all buffer. It might be even better to add clearAllMarkers to the clear function of the buffer (?) EDIT: The search-addon decorations are very hard to see with the background changes. |
@silamon since markers are changing to work also in the alt buffer we'll need to cover all marker use cases, this means making them invalid when alt -> normal happens. To validate which solution is best you could also run this while the alt buffer is up: const m = term.registerMarker(); Switch the the normal buffer and make sure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work as expected 👍
Adding to |
Fixes #3918
An additional event to trigger on buffer change wasn't needed, since the onWriteParsed is being triggered.