Conversation
A pane rendering Hangul would garble mid-screen and stay that way until an unrelated window resize repaired it. The WebGL renderer caches rasterized glyphs in fixed-size atlas pages, and the GPU can bind only so many at once. ASCII fills one page; a CJK viewport needs hundreds of double-width glyphs keyed by character *and* color, so it hits the page limit and forces a merge that renumbers every cached glyph. WebglRenderer rebuilds the model when that happens, up to 32 times per frame — but each rebuild rasterizes again and can trip another merge, so a CJK viewport never converges. The loop then gives up and paints a model half-built against page indexes the last merge invalidated. Nothing marks those rows dirty again, so the garble persists until a resize forces a full rebuild. - Request another frame when the retry budget is exhausted, capped at 4 consecutive frames so an oversubscribed atlas cannot spin the render loop. - Raise the atlas page size to 1024px: 4x the glyphs per page, so a CJK viewport fits the texture budget and the merge path stays cold. Also add CJK entries to the terminal font chain. Every font in it was Latin-only, so Hangul fell to a proportional system face whose advance is not two cells wide and drifted out of the grid. Coding faces with exact dual-width metrics come first, then platform defaults native-before-foreign, each listed under both its English and localized family name — a CJK-locale OS registers these faces under the localized name only. The chain moves to lib/terminal-font-family.ts, which folds in the second, already-drifted copy the pane defaults carried.
Owner
Author
|
CI validation complete: full matrix green (45 checks; only the fork-irrelevant community-PR labeler failed for lack of upstream secrets). Upstream PR stablyai#13765 is now ready for review. |
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.
Fork-internal PR to run the pr.yml check matrix before the upstream PR leaves draft. Not for merge.