fix(terminal): skip WebGL renderer on software-only GPU#3362
Merged
gregpriday merged 3 commits intodevelopfrom Mar 16, 2026
Merged
fix(terminal): skip WebGL renderer on software-only GPU#3362gregpriday merged 3 commits intodevelopfrom
gregpriday merged 3 commits intodevelopfrom
Conversation
- Add isWebGLHardwareAccelerated helper to detect software GPU via app.getGPUFeatureStatus().webgl2 - Include gpuWebGLHardware boolean in APP_HYDRATE IPC payload - Add hardwareAvailable instance field and setter on TerminalWebGLManager - Thread GPU status from stateHydration through TerminalInstanceService to WebGL manager - Add comprehensive tests for GPU detection, WebGL skip behavior, and hydration propagation
…tests - Move isWebGLHardwareAccelerated to electron/utils/gpuDetection.ts - Use gpuStatus.webgl2 directly instead of unsafe Record cast - Fix test import to avoid pulling in Electron app module chain
- Add toHaveBeenCalledTimes(1) to all three GPU propagation tests - Ensures setGPUHardwareAvailable is called exactly once per hydration
Collaborator
Author
|
Review status: Ready
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@xterm/addon-webglto terminals. When Chromium reports WebGL assoftware_only(CPU-emulated via llvmpipe or ANGLE fallback), WebGL attachment is skipped entirely and terminals fall back to the DOM renderer automatically.app/state) so the renderer can read it at startup throughstateHydration.electron/utils/gpuDetection.tsto keep the IPC handler thin and the helper independently testable.Resolves #3280
Changes
electron/utils/gpuDetection.ts— new helper that readsapp.getGPUFeatureStatus().webgl2and returns whether hardware WebGL is availableelectron/ipc/handlers/app/state.ts— surfacesgpuWebGLAvailableflag in the app state IPC responseshared/types/ipc/app.ts— addsgpuWebGLAvailable: booleanto theAppStatetypesrc/utils/stateHydration.ts— hydrates the GPU flag into a module-level export consumed byTerminalWebGLManagersrc/services/terminal/TerminalWebGLManager.ts— guardsensureContext()with the hydrated GPU flag; logs a clear message when WebGL is skippedsrc/services/terminal/TerminalInstanceService.ts— callshydrateGpuState()at startup before any terminal is createdTesting
TerminalWebGLManager.test.ts,stateHydration.test.ts,app.gpuDetection.test.ts)npm run checkpasses cleanly (typecheck, lint, format)CANOPY_DISABLE_WEBGL=1env override continues to work alongside the new runtime check