Repository navigation
Description
Describe the bug
When running the latest version of Superset desktop with approximately 7–8 Claude Code tabs open simultaneously, the UI intermittently renders garbled/corrupted text. The corruption appears primarily in code blocks, diff views, and terminal output areas — especially when working with Chinese content.
The underlying data is not corrupted: refreshing the workspace or restarting Superset immediately restores correct rendering. This points to a rendering-layer issue rather than an encoding or data problem.
Steps to reproduce
- Open Superset desktop (latest version)
- Create ~7–8 Claude Code workspaces/tabs
- Work with Chinese-language prompts and content across multiple tabs
- Switch between tabs and interact with chat outputs (code blocks, diffs, terminal)
- After some time, parts of the UI render as garbled/corrupted characters
Expected behavior
All text — Chinese and ASCII — should render consistently and remain readable regardless of the number of open tabs.
Actual behavior
- Characters in code blocks, diff views, and/or terminal output become garbled
- Both CJK and Latin characters can be affected
- The corruption is transient: refresh or restart fixes it
- It tends to happen more frequently with many tabs open
Workarounds
- Refresh the affected workspace/tab
- Restart Superset
Both restore normal rendering, but the issue can recur.
Environment
- App: Superset desktop (latest)
- OS: macOS
- Content language: Chinese
- Open tabs: ~7–8 Claude Code tabs
Suspected area
This is likely related to the xterm.js WebGL renderer and/or font shaping under memory pressure from many concurrent terminal instances. Relevant code paths:
- xterm addons (
apps/desktop/src/renderer/lib/terminal/terminal-addons.ts):WebglAddon,LigaturesAddon, andUnicode11Addonare all loaded per terminal instance. WebGL context loss handling exists but may not cover all corruption scenarios under heavy multi-tab usage. - Code block rendering (
packages/ui/src/components/ai-elements/code-block.tsx): Shiki-based syntax highlighting withdangerouslySetInnerHTML— if the async highlight promise resolves with stale/corrupt state, it could produce garbled output. - Diff rendering (
packages/ui/src/components/ai-elements/file-diff-tool.tsx): Inline diff lines rendered via plain text — less likely but still in the affected visual area. - shiki-wasm worker pool (
apps/desktop/src/renderer/routes/_authenticated/layout.tsx:188): A shared pool of 8 workers handles syntax highlighting; under heavy load with many tabs, worker contention or message interleaving could corrupt highlight results.
Related issues
- [bug] Sometimes the displayed Chinese characters are garbled. #3406 — Chinese characters garbled (same symptom, less detail)
- [bug] Terminal Output Corruption (Garbled CJK Characters) and Layout Glitches during Heavy Usage #3527 — Terminal output corruption with CJK during heavy usage
- [Bug] Latin/ASCII characters render as corrupted glyphs when mixed with Chinese text #3570 — Latin/ASCII corrupted when mixed with Chinese text
- [bug] macOS terminal rendering can corrupt and ghost into chat until fullscreen toggle #3504 — macOS terminal rendering corruption and ghosting (WebGL texture atlas theory)
- [perf] Terminal stream events lack client-side batching before xterm.write() #2241 — Terminal stream events lack client-side batching (related perf concern)
This issue adds a specific reproduction pattern (many concurrent Claude Code tabs + Chinese content) and cross-references the chat rendering layer in addition to the terminal layer.
Activity
day0n commentedon Apr 19, 2026
github-actions commentedon Apr 19, 2026
Investigated this bug but couldn't produce a unit-test reproduction. Notes below in case they help narrow future work.
What I checked
packages/ui/src/components/ai-elements/code-block.tsx— ran exploratory tests againsthighlightCodewith CJK input, ~20 concurrent highlights, unknown-language fallback, and line-number transformer reuse across concurrentcodeToHtmlcalls sharing a transformer array. All produced correct output. TheuseEffectcleanup flag correctly gates stale promise resolutions, and the shared line-number transformer does not cross-contaminate because eachcodeToHtmlparses a fresh AST.packages/ui/src/components/ai-elements/file-diff-tool.tsx—buildSimpleDiff/getDiffLinesare pure UTF-16 string operations (split("\n"),slice(1)), so CJK cannot corrupt; worst case is noisy output, not garbled glyphs.apps/desktop/src/renderer/lib/terminal/terminal-runtime.ts— noted thatrestoreBuffer(which callsterminal.write) runs beforeloadAddons, so the Unicode 11 provider isn't active when the persisted buffer is parsed. For common CJK ranges Unicode 6 and 11 agree on width, but edge-case ideographs, newer emoji, and ZWJ sequences could end up with wrong widths baked into the buffer. Could be a minor contributor but doesn't explain the general garbled text.apps/desktop/src/renderer/lib/terminal/terminal-addons.ts—onContextLossdisposes the WebGL addon on that terminal but does not setsuggestedRendererType = \"dom\"globally, so subsequent terminals re-attempt WebGL. Under the browser's per-document WebGL context cap (~16), this can cause cascading context loss as tabs open. Still a symptom, not proven to produce the glyph corruption shown.Why no PR
The most likely root causes (xterm WebGL texture-atlas corruption under context-loss cascades, shared shiki-wasm worker pool in
@pierre/diffs, memory pressure across many live WebGL contexts) only manifest in a real browser + GPU + many open tabs. They can't be exercised frombun:testwithout standing up an Electron / Playwright harness, and the logic-level code paths I could test don't fail.Refs #$ISSUE_NUMBER
johann-taberlet commentedon Apr 19, 2026
I have the same problem very often. For me, the quickest workaround is to resize the Superset window, and the rendering returns to normal. That's the only criticism I can make of this application so far.
Kitenite commentedon Apr 20, 2026
Taking a look at this atm, thanks for the patience!
fix(desktop): restore terminal buffer after Unicode 11 activation
fix(desktop): restore terminal buffer after Unicode 11 activation (#3581
nnnnoel commentedon Apr 22, 2026
@Kitenite It's not fixed when i see.
Kitenite commentedon Apr 22, 2026
Hey sorry about that will take another look
fix(desktop): raise Chromium WebGL context cap to 256 (#3834)
Kitenite commentedon May 6, 2026
Related reports (cross-referenced during issue triage — same area, may or may not share a root cause):
valentin-ib commentedon May 10, 2026
Reproducible in environments without Chinese-character text too.
Can confirm it happens when a lot of agent conversations are open, and resolves itself on app refresh / update.
jnelken commentedon May 19, 2026
Kitenite mentioned it's an xterm issue. Please comment and vote this potential fix:
vahidkowsari commentedon May 19, 2026
I see this on a daily basis. Could it be font related? I use the Menlo and also jetbrains mono fonts.
fix(desktop): raise Chromium WebGL context cap to 256 (ParadevAI#3834)
justincrich commentedon May 23, 2026
Picking this up — opened #4893 which bumps
@xterm/*to6.1.0-beta.220(and@xterm/addon-webglto0.20.0-beta.219) to consume xtermjs/xterm.js#5883 "Fix webgl rendering corruption from atlas page merges" merged 2026-05-21 by Tyriar.The upstream PR fixes two atlas-merge bugs that produce the exact wrong-glyph rendering symptom described here. Tyriar's approval comment on PR #5883 calls out our use case:
PR #5883 is cross-referenced as closing this issue plus the sibling cluster (#3527, #3794, #4601, #4639, #4617). Beta.220 was already published to npm and multiple downstream consumers (VSCode #317927, Alfredo, Ouroboros) are bumping to consume it.
Defense-in-depth: also added a one-line VSCode-pattern (microsoft/vscode#120393) fallback inside both
onContextLosshandlers — setssuggestedRendererType = "dom"for the rarer GPU-process-death class of failure that bypasses the atlas-merge fix.See PR #4893 for the binding scope, test plan, and full reasoning.
fix(desktop): bump @xterm/* to beta.220 for upstream WebGL atlas-merg…
fix(desktop): bump @xterm/* to beta.220 for upstream WebGL atlas-merg…
Kitenite commentedon Jul 11, 2026
Closing as a duplicate of #5605, the consolidated tracker for stale
terminal-renderingissues from the July 2026 stale-issue sweep (no activity since 2026-06-01). If this still applies on a current build, comment on #5605 and we'll reopen.fix(term): 多开窗口后终端花屏——限制 WebGL 上下文只给可见 tab