Skip to content

[bug] CJK glyph corruption in terminal output (1.9.6) #4639

Closed as duplicate

Description

@4dollar4

Description

When rendering text in Superset Terminal 1.9.6 (1.9.6), glyphs appear corrupted — characters overlap each other and some are drawn as broken or unrecognizable shapes, making the output unreadable. The issue is most visible with Korean (Hangul) text and with mixed Korean/Latin output.

This appears to be a font rendering or CJK grid-cell width calculation issue rather than a content problem: the underlying byte stream is intact (the same commands render correctly in other terminal emulators such as Terminal.app and iTerm2).

Steps to reproduce

  1. Open Superset Terminal 1.9.6 (1.9.6)
  2. Run a command that prints Korean text, e.g. echo "한글 테스트 통합 참조"
  3. Observe the rendered output in the terminal window

Output (screenshot)

The following is what is actually rendered in Superset Terminal when printing Korean + Latin text. Hangul syllables overlap and several glyphs are replaced with broken shapes.

Image

Expected: Hangul and Latin characters render with correct glyphs and no overlap, identical to how the same byte stream renders in other terminals.

Environment

  • App: Superset Terminal 1.9.6 (1.9.6)
  • OS:
  • Font:
  • Font size / line height:
  • Install method:

Additional notes

  • Reproduces with Latin-only text?
  • Reproduces with other fonts?
  • Same text renders correctly in Terminal.app and iTerm2 on the same machine.

Activity

  1. github-actions commented on May 16, 2026

    @github-actions
    Contributor

    Triage note: I looked at this but couldn't write a bun:test reproduction. A short writeup of what I checked and why a test isn't feasible:

    What's affected

    • Terminal renderer lives in apps/desktop/src/renderer/lib/terminal/. Addons are loaded in terminal-addons.ts: Unicode11Addon (with activeVersion = "11"), LigaturesAddon, WebglAddon (deferred to rAF), plus ClipboardAddon/ImageAddon/SearchAddon/ProgressAddon.
    • Width/cell logic is in apps/desktop/src/renderer/lib/terminal/links/buffer-helpers.ts and is already covered by CJK regression tests (buffer-helpers.test.ts), including Hangul ranges (0x1100–0x115F Jamo and 0xAC00–0xD7A3 Syllables) and a regression for #147619.
    • Default font stack in apps/desktop/src/renderer/lib/terminal/appearance/index.ts is JetBrains Mono, …, Menlo, Monaco, Courier New, monospace — none of these primary entries ship Hangul glyphs, so Korean characters are drawn from a browser/OS fallback font.

    Why a unit test isn't feasible
    The reported symptom is glyph corruption at the pixel level (characters overlapping, broken/unrecognizable shapes) while the input byte stream is intact (same bytes render fine in Terminal.app/iTerm2). That points squarely at the rendering pipeline — @xterm/addon-webgl's glyph atlas, font fallback for missing CJK glyphs, or @xterm/addon-ligatures interaction with non-Latin shaping. bun:test runs in Node without a real DOM/Canvas/WebGL context, so it can't exercise the renderer that produces these glyphs. The width-calculation path (the only logic-level slice of the problem) is already tested and passing.

    Likely culprits worth investigating in a real Electron build

    1. Font fallback mismatch — JetBrains Mono measures cell width from a Latin glyph; the fallback Hangul font's intrinsic glyph width may not match, producing overlap. A targeted fix would be adding a CJK-capable monospace (e.g. D2Coding, Nanum Gothic Coding, Noto Sans Mono CJK KR) ahead of the generic monospace in DEFAULT_TERMINAL_FONT_FAMILIES.
    2. LigaturesAddon × CJK — LigaturesAddon is loaded unconditionally; if the active font doesn't expose Hangul glyphs but ligature shaping still emits cell hints, the WebGL renderer can draw the wrong glyph at a cell. Worth testing by temporarily skipping loadAddon(new LigaturesAddon()) and re-running the repro.
    3. WebGL glyph atlas — @xterm/addon-webgl (0.20.0-beta.196 here) has a history of atlas-corruption bugs with non-Latin text; falling back to the DOM renderer (set suggestedRendererType = "dom" in terminal-addons.ts:17 or short-circuit before the rAF loadAddon(new WebglAddon())) would confirm.

    Repro environment notes the reporter could fill in that would help: macOS version, exact font in use (default vs custom), and whether disabling ligatures or the WebGL renderer makes the corruption go away.

    Refs #4639

  2. Kitenite commented on May 16, 2026

    @Kitenite
    Member

    Hi looking at this now

  3. Kitenite commented on May 16, 2026

    @Kitenite
    Member

    Hi added a fix for this but could you also try resizing the terminal see if that fixes for the time?

  4. 4dollar4 commented on May 17, 2026

    @4dollar4
    Author
    Image Unfortunatly, It's not working..
  5. bwalding commented on May 18, 2026

    @bwalding

    Hi added a fix for this but could you also try resizing the terminal see if that fixes for the time?

    I'm getting the glyph corruption on generally regular English text - but resizing did fix it for me. Thanks for the tip.

  6. igorkulman commented on May 18, 2026

    @igorkulman

    Happens to me also with regular English output from Claude Code and Pi.

    Image
  7. dknell commented on May 18, 2026

    @dknell

    Same, this one is very frustrating because it constantly interrupts work.

  8. jnelken commented on May 18, 2026

    @jnelken

    Some feedback:

    • It only happens to me after long sessions without restarting the application, with many terminal sessions running
    • Closing the terminal window and resuming the session in another will fix it, but the issue returns quickly after switching tabs a few times, or if more window history gets generated.
    • Restarting the app will fix it temporarily, but unless I cut back the amount of terminal sessions (or GPU load)? it will come back again
  9. kkak10 commented on May 19, 2026

    @kkak10

    +1 Same issue here — I'm using a CJK language (Korean). Resizing the terminal fixes it temporarily, but it breaks again shortly after.

  10. jnelken commented on May 19, 2026

    @jnelken
  11. kkak10 commented on May 22, 2026

    @kkak10

    @Kitenite Since xtermjs/xterm.js#5883 has been merged, could you bump xterm to 6.1.0-beta.220?

    This should hopefully resolve the issue.

  12. Kitenite commented on Jul 11, 2026

    @Kitenite
    Member

    Closing as a duplicate of #5605, the consolidated tracker for stale terminal-rendering issues 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.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions