Repository navigation
fix(ui): fix multi-pane WebGL glyph corruption (xterm atlas-merge fix) - #262
Merged
Merged
Conversation
Split-chat WebGL terminals rendered correct layout but WRONG GLYPHS on sibling panes once agentic CLIs (claude-code/codex) emitted a wide range of styled cells. Root cause is an upstream xterm.js WebGL texture-atlas page-merge defect (xtermjs/xterm.js#5883), not our code: it predates the in-app atlas workaround and is cross-platform (reproduced on Chromium as well as WKWebView). Bump @xterm/* to the fixed beta train (xterm 6.1.0-beta.220, addon-webgl 0.20.0-beta.219, addon-fit 0.12.0-beta.219, addon-web-links 0.13.0-beta.219 — the set VSCode consumes) and delete the now-dead cross-pane atlas coordination (atlasPeers fan-out, refreshAllTerminalAtlases, per-terminal repaint/rebuild hooks, and the redundant activation-path clearTextureAtlas) that only masked the symptom and was itself the sibling flicker. Keep per-terminal WebGL plus the context-loss -> DOM fallback, and the font-change atlas rebuild.
ChatPaneGroup's geometry sync ran on every commit (empty deps), redoing an all-panes getBoundingClientRect + write on unrelated re-renders. Scope it to [layout.root] and sync a terminal wrapper when its ref mounts, so a session attaching into an already-hydrated pane (restored-split hydration) is still positioned without the per-commit churn.
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.
Bug
In a multi-pane chat tab, sibling panes render correct layout but wrong glyphs ("gibberish" — see below) once an agentic CLI (claude-code / codex) in another pane paints a busy frame. Text stays selectable/correct underneath; only the WebGL render is garbled. It shows up when one pane is starting/busy while a sibling is idle, and per-pane resume/start visibly disturbed siblings.
Root cause
This is an upstream xterm.js WebGL texture-atlas page-merge defect — xtermjs/xterm.js#5883 (merged by Tyriar 2026-05-21), not our code:
clearTextureAtlasshotgun never fixed it and only added sibling flicker.Fix
Bump
@xterm/*to the fixed beta train (the exact set VSCode consumes — microsoft/vscode#317927):@xterm/xterm@xterm/addon-webgl@xterm/addon-fit@xterm/addon-web-linksThen delete the now-dead cross-pane atlas machinery (
atlasPeersfan-out,refreshAllTerminalAtlases, the per-terminal repaint/rebuild hooks, and the redundant activation-pathclearTextureAtlas) that only masked the symptom. WebGL is kept per-terminal, along with theonContextLoss→ DOM fallback and the font-change atlas rebuild.Also included (unrelated tidy)
refactor(ui): scope pane-group geometry sync to layout changes—ChatPaneGroup's geometry sync ran on every commit (empty deps), redoing an all-panesgetBoundingClientRect+ write on unrelated re-renders. Now scoped to[layout.root], with a sync when a terminal wrapper's ref mounts so restored-split hydration still positions late-attaching panes. Separate commit; safe to review independently.Caveat
@xterm/xtermcore is a beta release — the fix is not in a stable tag yet. VSCode ships this same beta, and it's a minor (6.0 → 6.1) bump, so risk is low, but flagging it since it adopts a beta dependency.Testing
pnpm exec tsc --noEmit,pnpm run lint,pnpm run build(tsc && vite build) — all clean.pnpm install --frozen-lockfile --offlineclean,git diff --checkclean).🤖 Generated with Claude Code