-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
terminal: bump xterm
and addons
#12691
Conversation
3328356
to
abc4578
Compare
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.
The change works well on Chromium based browsers, but breaks on FireFox, since we do a bit of monkey-patching:
theia/packages/terminal/src/browser/terminal-widget-impl.ts
Lines 644 to 661 in abc4578
const renderService: any = (this.term as any)._core._renderService; | |
const originalFunc: (entry: IntersectionObserverEntry) => void = renderService._onIntersectionChange.bind(renderService); | |
const replacement = function (entry: IntersectionObserverEntry): void { | |
if (entry.target.ownerDocument !== document) { | |
// in Firefox, the intersection observer always reports the widget as non-intersecting if the dom element | |
// is in a different document from when the IntersectionObserver started observing. Since we know | |
// that the widget is always "visible" when in a secondary window, so we mark the entry as "intersecting" | |
const patchedEvent: IntersectionObserverEntry = { | |
...entry, | |
isIntersecting: true, | |
}; | |
originalFunc(patchedEvent); | |
} else { | |
originalFunc(entry); | |
} | |
}; | |
renderService._onIntersectionChange = replacement; |
_onIntersectionChange
doesn't seem to be a method in the renderService
anymore.
I was able to get it to work again by replacing the existing code with this: const renderService: any = (this.term as any)._core._renderService;
const originalFunc: (entry: IntersectionObserverEntry) => void = renderService._handleIntersectionChange.bind(renderService);
const replacement = function (entry: IntersectionObserverEntry): void {
if (entry.target.ownerDocument !== document) {
// in Firefox, the intersection observer always reports the widget as non-intersecting if the dom element
// is in a different document from when the IntersectionObserver started observing. Since we know
// that the widget is always "visible" when in a secondary window, so we refresh the rows ourselves
renderService._pausedResizeTask.flush();
renderService.refreshRows(0, renderService._rowCount - 1);
} else {
originalFunc(entry);
}
};
renderService._handleIntersectionChange = replacement; |
@msujew good catch and thank you for the suggestion! I'll add you as a co-author whenever we merge :) |
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.
I'll tentatively approve. There is still one edge case on FireFox that seems to experience a regression: When maximizing a secondary terminal widget, the renderer becomes quite sluggish, only updating every few seconds.
However, I couldn't figure out what causes it or how to resolve it, so I'll approve anyway. I think it's a rare enough issue. Maybe @tsmaeder can chime in and see how to fix it?
@msujew if I look at the relevant code change in |
Yep, just using the correct method fixed the error in the console, but terminals still experienced a render issue. Any terminal didn't re-render anymore after popping it out to a secondary window. |
I think this is worth investigating: if you look at the code in RendererService.ts, I think the only time the |
f572553
to
9e63a03
Compare
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.
Putting a block on this one so nobody accidentally merges it: I believe we have a performance problem with incremental updates after the library update.
The commit bumps `xterm` and related addons to their latest versions to benefit from additional improvements and bug fixes. Signed-off-by: vince-fugnitto <[email protected]>
Signed-off-by: vince-fugnitto <[email protected]>
@msujew can you remember what the exact rendering issue was on firefox? For me, there are rendering issues when I resize the external window, but they are the same on chrome and on firefox. |
Sure, go ahead! |
- reestablished patch for intersection observer - enabled scroll bars on Firefox Signed-off-by: Thomas Mäder <[email protected]>
9e63a03
to
538dc95
Compare
Signed-off-by: Thomas Mäder <[email protected]>
@msujew I fixed the tests. Could you give this one another review? |
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.
Yep, perfect. Works good now. No sluggishness on Firefox anymore.
What it does
The pull-request bumps
xterm
and related addons to their latest versions to benefit from additional improvements and bug fixes.How to test
split terminal
works as expectedReview checklist
Reminder for reviewers