Text stays invisible after GPU reset recovery (WebGL context recovers, but shared glyph atlas is stale) - zooming shows text, resetting zoom hides it again

Open Beginner friendly
#11,615 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start in xtermFrontend at recoverRenderer() and attachWebGLAddon(), then compare the existing displayMetricsChanged$ handler that calls clearTextureAtlas(). Verify that the recovery path clears the WebGL and/or canvas atlas after re-attachment, and confirm that text remains visible after a GPU reset and subsequent zoom changes.

Written by the indexing model from the issue text.

Description

Version: 1.0.235
Platform: Windows 11 Pro (22621), NVIDIA GPU
Frontend: xterm-webgl

Describe the problem

After a Windows display driver TDR (System log: Display Event ID 4101 "Display driver nvlddmkm stopped responding and has successfully recovered", plus nvlddmkm 153), Tabby's GPU process restarted and the WebGL context recovery from #11354 appears to succeed, but all terminal text in the affected window is invisible. The cursor and background render fine and the shell keeps working — only the glyphs are missing.

Key symptom: pressing Ctrl+= (zoom in) makes the text appear immediately; pressing Ctrl+0 / Ctrl+- back to the original size makes it disappear again. Focusing the window, switching tabs, and resizing the window have no effect.

Suspected cause

xterm.js keeps the glyph texture atlas in a module-level cache shared by every terminal in the window with the same font config (charAtlasCache / ownedBy[]). The GPU reset wipes the atlas canvas bitmaps, but the atlas bookkeeping still marks the glyphs as rasterized, so they are drawn as empty. Zooming changes the cache key, so a fresh atlas is created and text renders. Zooming back reuses the stale shared atlas (still owned by the other tabs), so the text is blank again.

The recovery path in xtermFrontend (recoverRenderer()attachWebGLAddon()) re-creates the addon, but never calls clearTextureAtlas(), so the stale atlas survives the recovery.

Possible fix

Call webGLAddon.clearTextureAtlas() (and/or canvasAddon.clearTextureAtlas()) after a successful re-attach in recoverRenderer(), the same way it is already done for displayMetricsChanged$.

To reproduce

  1. Open several terminal tabs in one Tabby window (xterm-webgl frontend).
  2. Force a GPU driver reset with Win+Ctrl+Shift+B.
  3. Text in the tabs is invisible. Ctrl+= shows it, Ctrl+0 hides it again.

Workaround that restores text without restarting (confirmed)

Toggle "Automatically hide the taskbar" on and off in Windows settings. This fires display-metrics-changed, and Tabby's existing handler calls clearTextureAtlas() on every terminal, which immediately restores all text in every tab. This also confirms that the stale atlas is the cause and that clearing it after a successful context recovery would fix the issue.

Logs

  • Windows System log: Display 4101 + nvlddmkm 153 at the time of the reset
  • Tabby: a new --type=gpu-process child process was spawned 2 seconds after the event, while the main process and the renderer kept running
Dominant language
TypeScript
Stars
74.6k
Forks
4.3k
Avg merge
8d 1h
Merged PRs (30d)
13

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Eugeny/tabby

All issues in Eugeny/tabby

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.