Skip to content

(terminal): stale WebGL glyph atlas garbles rows whose buffer text is correct #502

Open

Description

@devsuitup

What happens

A Claude session's terminal shows garbage glyphs over whole rows (the first-run welcome art, the menu below it) while plain-ASCII rows on the same screen render correctly. Seen on the v0.0.90 candidate (PR #500, Windows 11, Intel Iris Plus via ANGLE D3D11, DPR 2, 1400x900).

Measured on the live instance (read-only, through the debug port)

  • The xterm buffer holds the correct text ("Welcome to Claude Code v2.1.295", the block-art characters, the theme menu): the bytes are fine, the corruption is in the WebGL renderer.
  • WebGL addon active (@xterm/addon-webgl 0.19.0, @xterm/xterm 6.0.0, Electron 41.0.3), MAX_TEXTURE_SIZE 16384, cell 7x14 css / 14x28 device (integer).
  • webglAddon.clearTextureAtlas() + terminal.refresh(0, rows-1), run once, repaired every glyph.
  • The existing heal paths did not fire a repair: loadTerminalWebgl repaints on onChangeTextureAtlas / onAddTextureAtlasCanvas, and forceRepaint clears the atlas on reveal. So the atlas went bad without a change event, or after the last repaint.
  • No @xterm/* or Electron bump in six weeks; the only dependency change in the path is node-pty 1.2.0-beta.15 ((terminal): move node-pty to 1.2.0-beta.15 (#409) #431), unrelated to a renderer-side atlas.

Hypotheses (to decide by measurement)

  1. Atlas corruption in addon-webgl 0.19 at DPR 2 on ANGLE D3D11 when many new box/block glyphs arrive at once. Decide: with the activity trace on, count atlas events on a fresh first-run screen; same buffer with the WebGL addon disposed (DOM renderer).
  2. Two WebGL contexts created at nearly the same time (main terminal + panel shell), as in (terminal): a resize while another terminal's WebGL context starts can paint it blank #353. Decide: create them sequentially and compare.
  3. Texture upload on first paint while fonts settle. Decide: read the atlas canvas before clearing it.

Wanted

The measurement first, then a fix that heals without user action (e.g. clear the atlas when a burst of new glyphs lands, or on a detected mismatch), with a test that loads the shipped terminal-manager.js. The Refresh control already clears the atlas: say whether it does, as a manual workaround meanwhile.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions