Skip to content

Fix wide Unicode cell rendering#75

Open
ctate wants to merge 1 commit into
mainfrom
ctate/fix-54
Open

Fix wide Unicode cell rendering#75
ctate wants to merge 1 commit into
mainfrom
ctate/fix-54

Conversation

@ctate
Copy link
Copy Markdown
Collaborator

@ctate ctate commented May 16, 2026

Fixes #54

Co-authored-by: Nathan Brake <33383515+njbrake@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wterm Ready Ready Preview, Comment May 16, 2026 8:56pm

Comment on lines +300 to +302
if (col === cursorCol) {
appendStyledSpan("term-cursor", "", " ");
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (col === cursorCol) {
appendStyledSpan("term-cursor", "", " ");
}

When cursor is on a wide character's continuation cell (width=0), a redundant cursor-styled space span is emitted, breaking grid alignment.

Fix on Vercel

@codevibesmatter
Copy link
Copy Markdown

👋 Stacked this on top of #81 locally + ran it against Claude Code's TUI in our identity-shell drawer on a production-ish staging deploy. The wide-char displacement that was producing visible artifacts in Claude's animated indicators (✦ Cooking for Xs, ✦ Herding…) — characters appearing 1 visual column right of where they belong, text fragments like "ightrrent branxh status" — is fixed by the combined branches.

Specifically the bug pattern that goes away:

  • Animated wide glyphs ( U+2726, others) in Claude's spinner/progress UI no longer push subsequent narrow chars right by 1 cell per occurrence.
  • The "Welcome back Ben!" intro panel's multi-column layout (left tips / center logo / right what's-new) lines up correctly because wide chars in panel headers don't shift cells anymore.
  • Combined with fix(@wterm/dom): pixel-snap upper-block gradients to prevent sub-pixel misalignment #81's pixel-snapped gradient stops, Claude's ▔▔▔▔▔ horizontal rules render as a smooth line.

Heads-up on a pre-existing failure I hit running pnpm test on this branch: @wterm/react tests fail 14/14 with what looks like a useTerminal hook output-shape change that the test mocks weren't updated for. Doesn't touch the integration path (DOM + WASM both clean), but might block CI green.

Happy to ship the stacked-on-main rebase as a PR if it'd help unstick this one. Strong demand for it from a real-world Claude Code workload.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wide characters (CJK, emoji) advance cursor by only 1 cell, desyncing the grid

2 participants