Skip to content

fix: revert to canvas renderer for xterm #8138

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

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Jun 21, 2023

The default changed from canvas to DOM in the last update. The canvas renderer resolves line spacing issues and has better performance, as well as bringing us back to the previous status quo.

In the new version the canvas is enabled via an addon.

Fixes #7953.

@code-asher code-asher changed the title fix: go back to canvas renderer for xterm fix: revert to canvas renderer for xterm Jun 21, 2023
The default changed from canvas to DOM in the last update.  The canvas
renderer resolves line spacing issues and has better performance, as
well as bringing us back to the previous status quo.
@code-asher code-asher force-pushed the asher/xterm-canvas branch from 3d71f40 to 029c6d3 Compare June 21, 2023 20:43
@code-asher code-asher marked this pull request as ready for review June 21, 2023 21:32
@code-asher code-asher requested review from a team, rodrimaia and Kira-Pilot and removed request for a team and rodrimaia June 21, 2023 21:33
@@ -38,7 +38,7 @@ Object.defineProperty(window, "TextEncoder", {
const renderTerminal = async (
route = `/${MockUser.username}/${MockWorkspace.name}/terminal`,
) => {
const utils = renderWithAuth(<TerminalPage />, {
const utils = renderWithAuth(<TerminalPage renderer="dom" />, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because Jest can't handle canvas elements? If so, how was this test working before? Asking because I'm curious if this canvas switch is the culprit behind #7948.

Copy link
Member Author

@code-asher code-asher Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup the Jest test looks for HTML elements which will only be present in the DOM renderer. Technically setting renderer here is not necessary since the default is already DOM but I added it be explicit.

Before the major bump to xterm, back when the default was canvas and before it was broken out into an addon, we would explicitly set rendererType to dom so it would have been using the DOM renderer then too.

Unfortunately I think that means #7948 is unrelated. If it was using canvas I think we would get a different error since .xterm-rows should not exist at all (we should have seen the error no xterm-rows instead).

Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@code-asher code-asher merged commit e2e07b0 into main Jun 27, 2023
@code-asher code-asher deleted the asher/xterm-canvas branch June 27, 2023 17:57
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gaps between lines and performance issues in web terminal
2 participants