-
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
WebGL rendering is broken on Safari Preview #3357
Comments
@prusnak Do you get any output at all? I think you should not - as far as I know Safari does not implement Webgl2 at all. Or did they change that recently? |
I did get the output - the background color of characters was rendered correctly. It's hard to see if the background is the same color everywhere, but if you use colorful output one can see that. I run the following script: for x in {0..8}; do
for i in {30..37}; do
for a in {40..47}; do
echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "
done
echo
done
done Chrome: Safari: |
I think you may need to switch in webgl2 via an experimental feature in Safari. I'm not sure if that changes on M1. |
Ah, it was actually the opposite :-) I had WebGL 2.0 enabled in experimental settings and turning it off fixed the issue for me. Feel free to close the issue if you want to. |
Ah ok, I guess that's why it's experimental then 😄. If it's off, loading the addon will throw and it will revert back to the DOM renderer. |
We're seeing this on ipad and the safari preview still |
@meganrogge and I looked into this just now, here's what we found:
|
This is now happening for release versions of Safari. Is there someway the WebGL renderer can be disabled for Safari until there's a fix? |
This seems to be a problem with the newly released Safari 15 on macOS Big Sur 11.6 as well... |
This is open for anyone to investigate why it's happening, the current recommendation is to disable the webgl extension on Safari. |
I guess this issue can be related to #3357 (it's also Safari, iOS, WebGL 2.0 is enabled by default). |
@bushev did you mean to paste in a different issue? FWIW the PR linked above will now cause the webgl addon to throw when you try to activate it on Safari as a temporary workaround. |
Got it, the issue I've pasted just looks similar to this rendering issue, since some characters are missing in the console. But disabling od WebGL 2.0 doesn't help to solve #3357. |
The check in https://github.com/xtermjs/xterm.js/blob/master/src/common/Platform.ts#L21:
doesn't seem to catch WKWebView, which is the browser engine powering Safari. Safari's user agent string (on an iPad) is:
Whereas WKWebView's user agent string (on an iPad) is:
This is causing the demo on https://xtermjs.org to not show any content in WKWebView. I've reported this at #3575 but I'm also mentioning it here in case it's relevant. |
Rendering was finally fixed in iPadOS 15.4 Safari and both canvas and the WebGL add-on work without a single char disappearing. After spending 6 months with the sluggish DOM renderer WebGL feels very fast. I did some performance testing and while it ran out of memory after adding the 8th parrot, until then I felt no performance hit. You can see for yourself in the clip I uploaded: seven dancing parrots and the invaders from space. |
@daonb Any pointers/traceback where things went overboard with 8th parrot? |
That's exciting if this will be fixed in the upcoming Safari! |
I suspect Safari ran out of canvas memory as it always does when I keep opening panes. All the parrots freeze and I there's no more canvas output. I added an |
I'm not sure I've seen the browser refusing to hand out GPU memory but that would be my guess as well. |
Are those panes full terminal instances (no clue how you do the multiplexing)? Because a single terminal instance can get quite demanding, depending on scrollback settings/buffer fillstate and/or incoming data pressure (without proper flow control). Then you might run into some sort of resource limits from the browser engine's JS context (could be any of RAM allocation, CPU perf, GPU limitations). |
@jerch pretty sure they're each individual instances |
Yes they are - whenever the user splits a terminal he gets a new terminal and a new WebRTC data channel. I should probably run a more focused benchmark - in this one each parrot comes from |
As stated in #3357 (comment) this is fixed in the current safari version. I just want to confirm that it works fine for me in Safari Version 15.4 (17613.1.17.1.13) with WebGL 2.0 enabled. |
Also works for me on 15.4 after removing this: xterm.js/addons/xterm-addon-webgl/src/WebglAddon.ts Lines 28 to 30 in d293883
Let's keep the workaround there for a while until 15.4+ is more widely spread https://caniuse.com/usage-table |
Safari tells you which version it's running via |
This does not fix the issue where webkit browsers cannot use it, I looked at webkit versions in safari and was a bit confused. The wikipedia page for safari shows v15 having webkit v612+ but I have safari v16 and it's webkit v605, so trying to detect it based on webkit version is a risky change. Fixes xtermjs#3357 Related xtermjs#3575 Related microsoft/vscode#165416
This does not fix the issue where webkit browsers cannot use it, I looked at webkit versions in safari and was a bit confused. The wikipedia page for safari shows v15 having webkit v612+ but I have safari v16 and it's webkit v605, so trying to detect it based on webkit version is a risky change. Note that webgl2 shipped in safari 15, but it didn't work in webgl until safari 16. Fixes xtermjs#3357 Related xtermjs#3575 Related microsoft/vscode#165416
Details
Steps to reproduce
The text was updated successfully, but these errors were encountered: