Repository navigation
Fix WSL2 terminal rendering fallback - #116
gsvprharsha merged 1 commit into
Conversation
|
@bferanmi806-sketch is attempting to deploy a commit to the Tempest OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for the review and merge, Harsha. Appreciate it. I had a look through the roadmap and I’d be keen to contribute more consistently rather than just pick up isolated issues. If there’s anything on the roadmap or anything not yet turned into an issue where an extra pair of hands would help, feel free to point me at it. I’d be happy to dig into it properly and open a pr |
|
That would be great. We are actually working on #117 right now. The issue has been in Windows. We are still exploring a standard solution across Mac, Windows, and Linux |
|
I can check through #117 from the cross-platform packaging side and see if there’s a cleaner approach that works consistently across Windows, macOS, and Linux. I’ll focus on understanding the current Atlas staging/resource flow first so I don’t duplicate anything you’re already working on. |
|
Sure! Thank you! Also if you want to, then you can join the discord server, we will add you to the contributors channel. We are actually planning on Moving atlas to rust and make it tightly integrated to avoid this. |
|
Oh I would love to join the discord server |
What changed
Under WSLg/WebKitGTK, WebGL context creation can succeed while landing on a software/slow rendering path, so Tempest's terminal silently falls into an extremely slow renderer.
src/lib/webglPool.tsonly falls back to xterm's canvas renderer when creating or loading theWebglAddonthrows, which never happens in this environment - matching the severe terminal FPS collapse reported in #35 (the file is unchanged since v0.1.18, the reported version).This PR makes Tempest deliberately skip
WebglAddonwhen running inside WSL/WSLg, keeping xterm on its normal non-WebGL renderer there, and leaves WebGL behaviour unchanged for Windows, macOS and ordinary native Linux. It deliberately does not setWEBKIT_DISABLE_DMABUF_RENDERERor disable WebGL for all Linux users.src-tauri/src/wsl.rs(new): cached WSL detection mirroring the semantics already used by Atlas inpackages/atlas/src/sync/watch-policy.ts(non-Linux -> false; non-emptyWSL_DISTRO_NAMEorWSL_INTEROP-> true without I/O; fallback to/proc/versioncontainingmicrosoft/wslcase-insensitively; unreadable/proc/version-> false). Detection inputs are injectable so tests do not depend on the build host OS.src-tauri/src/lib.rs: register the new cachedis_wslTauri command.src/lib/terminalRendererPolicy.ts(new): small injectable policy that resolves the WSL fact once, caches it, and exposesallowsWebgl(). A failed probe logs and preserves the previous WebGL behaviour (fail-open).src/lib/terminalRenderer.ts(new): wires the policy to theis_wslcommand.src/main.tsx: awaits the policy's singleinitialize()in the existing pre-mountPromise.all, so the platform fact is resolved before React mounts.src/lib/webglPool.ts:acquire()stays synchronous and gains one guard lineif (!terminalRendererPolicy.allowsWebgl()) return;.src/lib/terminalRendererPolicy.check.ts(new): regression check for the renderer policy.Resolving the fact once at startup keeps
webglPool.acquire()synchronous, so pool size (6), context-loss handling, release behaviour, terminal show/hide re-acquire and PTY sizing logic are untouched. Zen windows load the same entrypoint, so they are covered too.Related issue
Refs #35. Note: this addresses the severe FPS/rendering portion only. The reporter's startup warnings were never shared verbatim, so this PR does not claim to fix those unidentified warnings.
How was this tested
npx tsc --noEmit- clean.npm run build:frontend(tsc && vite build) - passes.cargo +1.97.1 checkandcargo +1.97.1 testinsrc-tauri- 32/32 pass, including 9 newwsl::unit tests coveringWSL_DISTRO_NAME,WSL_INTEROP,/proc/versionMicrosoft/WSL markers (case-insensitive), ordinary Linux false, non-Linux false even with env markers, unreadable/proc/versionfalse, and env short-circuit before any/procread.npm test terminalRendererPolicy(repo'stests/run.mjsnode checks) - covers WSL -> non-WebGL, native Linux/Windows/macOS -> WebGL, pending-then-resolved caching, concurrentinitialize()dedup, no per-pane IPC retries, and probe-failure fail-open behaviour.git diff --check- clean.mainvia stash:src/components/AgentQuotaStrip.check.tsfails because it imports../lib/quotawithout the.tsextensiontests/run.mjsrequires.Manual verification on an actual WSL2/WSLg setup (Ubuntu 22.04/24.04) is still needed to confirm the FPS improvement end-to-end; I could not run the Linux WebKitGTK target from my dev machine.
Checklist
npx tsc --noEmitpassescargo checkpasses (if backend changed)