Skip to content

Tighten webgl lifecycle, ensure chat doesn't use#285579

Merged
Tyriar merged 1 commit intomainfrom
tyriar/285452
Jan 2, 2026
Merged

Tighten webgl lifecycle, ensure chat doesn't use#285579
Tyriar merged 1 commit intomainfrom
tyriar/285452

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented Jan 1, 2026

The webgl renderer has a limited number of contexts, because there are potentially many chat terminals and interaction with them is minimal, we don't want to consume one of the contexts.

Fixes #285452

The webgl renderer has a limited number of contexts, because there are
potentially many chat terminals and interaction with them is minimal, we
don't want to consume one of the contexts.

Fixes #285452
@Tyriar Tyriar added this to the December / January 2026 milestone Jan 1, 2026
@Tyriar Tyriar self-assigned this Jan 1, 2026
Copilot AI review requested due to automatic review settings January 1, 2026 16:34
@Tyriar Tyriar enabled auto-merge January 1, 2026 16:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens WebGL renderer lifecycle management to prevent WebGL context leaks and ensures chat terminals don't consume limited WebGL contexts.

  • Adds explicit disposal of existing WebGL addons before creating new ones to avoid context leaks
  • Converts sticky scroll WebGL addon management to use MutableDisposable for better lifecycle control
  • Disables GPU acceleration for chat terminals to conserve the limited number of available WebGL contexts

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts Converts _webglAddon from optional property to MutableDisposable for automatic cleanup and adds disposal comment
src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts Adds explicit _disposeOfWebglRenderer() call before creating new WebGL addon and adds guard clause to disposal method
src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.ts Passes enableGpu: false option when attaching chat terminals to prevent WebGL context consumption

@Tyriar Tyriar merged commit 6cd5b46 into main Jan 2, 2026
33 of 34 checks passed
@Tyriar Tyriar deleted the tyriar/285452 branch January 2, 2026 00:16
@meganrogge
Copy link
Collaborator

Thanks for fixing!

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Feb 16, 2026
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.

Terminal intermittently shows white area that seems like failed to load something.

4 participants