Skip to content
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

Lazily create the canvas element #55

Closed
Tyriar opened this issue Jul 11, 2023 · 2 comments · Fixed by #56
Closed

Lazily create the canvas element #55

Tyriar opened this issue Jul 11, 2023 · 2 comments · Fixed by #56

Comments

@Tyriar
Copy link

Tyriar commented Jul 11, 2023

Images are pretty rare at least in my usage patterns, we would save a bunch of work by not creating/attaching/resizing the canvas until the first time it's needed

I know I'm blocking on xtermjs/xterm.js#4577 and will move this over when that goes in, trying to catch up 😅

@jerch
Copy link
Owner

jerch commented Jul 11, 2023

Yes thats a good idea and should also help with microsoft/vscode#187460.

We could even go one step further and remove the canvas for long living terminals, once the storage gets emptied (thus all image notions got finally removed from scrollback etc). Ofc this would create a tiny burden for canvas recreation upon the next image (which is a rather rare use case). Not sure if this helps much, it would at least save some resources on very big terminals. In the end there is not much use for a transparent canvas on top of everything else, if there is nothing to show on it at all.

@Tyriar
Copy link
Author

Tyriar commented Jul 11, 2023

👍 good idea, I was thinking about that with a timeout but when it scrolls off is even better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants