fix: restore CJK wide character support in ZerolagInput overlay#30
Closed
TeigenZhang wants to merge 1 commit intoArk0N:masterfrom
Closed
fix: restore CJK wide character support in ZerolagInput overlay#30TeigenZhang wants to merge 1 commit intoArk0N:masterfrom
TeigenZhang wants to merge 1 commit intoArk0N:masterfrom
Conversation
The xterm-zerolag-input refactor lost the CJK wide character handling that was previously in LocalEchoOverlay. This caused Chinese/Japanese/ Korean text to overlap during input because all characters were assumed to be 1 cell wide. - Add charCellWidth/stringCellWidth helpers to overlay-renderer.ts (prefers Unicode11 addon, falls back to Unicode range detection) - Fix makeLine to position chars by visual column offset (wide = 2 cols) - Fix renderOverlay cursor to use visual width instead of string length - Fix _render line splitting to wrap by visual column width - Add unicode property to XtermTerminal type, terminal to RenderParams - Bump asset version query strings for cache invalidation
Owner
|
Sorry about this — the CJK wide character support was lost during the refactor. I'll implement a clean fix directly on master that preserves the existing 4-space indentation style and only touches the lines that need to change. |
Ark0N
added a commit
that referenced
this pull request
Mar 4, 2026
Add charCellWidth/stringCellWidth helpers for Unicode-aware width detection, fix makeLine to use for...of iteration with visual column positioning, and fix line splitting in _render to use visual column widths instead of string length. CJK/fullwidth characters now correctly occupy 2 cell widths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
Merged via direct commit to master. All 124 tests pass, typecheck clean, lint/format clean. |
Ark0N
added a commit
that referenced
this pull request
Mar 4, 2026
Covers all 7 test plan items: Chinese overlap prevention, double-width spacing, Japanese/Korean input, cursor positioning, line wrapping at column boundaries, ASCII regression, and teammate terminal panels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Test plan executed ✅Added comprehensive CJK test suite in
File: Note on Test 7: Teammate panels share the same global |
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.
Summary
charCellWidth/stringCellWidthhelpers tooverlay-renderer.ts— prefers xterm Unicode11 addon'sgetStringCellWidth, falls back to Unicode range detection for CJK/fullwidth charactersmakeLine— usefor...ofiterator (proper Unicode code point iteration) with visual column offset positioning; wide characters get2 * cellWspan widthrenderOverlaycursor — usestringCellWidthinstead ofstring.lengthfor cursor column calculation_renderline splitting — replaceString.slicewith visual-column-width-aware splitting to prevent CJK characters overflowing line boundariesXtermTerminaltype withunicodeproperty; addterminaltoRenderParamsfor width detection passthrough?v=0.3.0→?v=0.3.1a) for cache invalidationContext
The
xterm-zerolag-inputpackage refactor (extractingLocalEchoOverlayintoZerolagInputAddon) lost the CJK wide character handling from PR #13. All characters were assumed to be 1 cell wide, causing Chinese/Japanese/Korean text to overlap during input.Files Changed
packages/xterm-zerolag-input/src/types.tsunicodetoXtermTerminal,terminaltoRenderParamspackages/xterm-zerolag-input/src/overlay-renderer.tsmakeLineandrenderOverlayfor CJKpackages/xterm-zerolag-input/src/zerolag-input-addon.ts_renderline splitting; passterminalto renderersrc/web/public/index.html?v=for cache invalidationTest plan