fix(terminal): refresh WebGL canvas after resume to prevent frozen terminal (#837)

This commit is contained in:
Jinwoo Hong 2026-04-19 15:07:49 -04:00 committed by GitHub
parent 7734cf9bef
commit 037acf64db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -301,6 +301,18 @@ export class PaneManager {
for (const pane of this.panes.values()) {
if (pane.gpuRenderingEnabled && !pane.webglAddon) {
attachWebgl(pane)
// Why: the fitPanes() optimization skips panes whose dimensions are
// unchanged (common when a worktree goes hidden→visible at the same
// window size). But the fresh WebGL canvas created by attachWebgl()
// has no painted content — without an explicit refresh the terminal
// appears frozen until something forces a dimension change (e.g. a
// split). This mirrors the onContextLoss handler in attachWebgl which
// calls the same refresh after falling back to the DOM renderer.
try {
pane.terminal.refresh(0, pane.terminal.rows - 1)
} catch {
/* ignore — pane may not be fully initialised yet */
}
}
}
}