Repository navigation
terminal: print codepoints above 0xFF unmapped in a charset, as xterm - #14554
Merged
Merged
Conversation
With a charset other than UTF-8 or ASCII designated (the DEC line-drawing set, say), printCell mapped every codepoint above 0xFF to a space. An emoji printed in that state became a blank, and since its width still came from the original codepoint, a two-column one, so the rest of the row shifted too. A designated set only applies to the range it is invoked into: G0 is invoked into GL (0x21-0x7E), so codepoints outside it pass through unchanged (DEC STD 070, following ISO 2022; xterm does the same). The charset tables already only remap codepoints in GL, so printCell now prints anything above 0xFF as is instead of replacing it with a space.
robmorgan
force-pushed
the
charset-width
branch
from
October 6, 2026 12:19
80a24e8 to
6220a36
Compare
mitchellh
approved these changes
Oct 6, 2026
mitchellh
enabled auto-merge
October 6, 2026 16:07
mitchellh
disabled auto-merge
October 6, 2026 18:21
This was referenced Oct 7, 2026
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.
With a charset other than UTF-8 or ASCII designated (e.g. the DEC line-drawing set),
printCellmapped every codepoint above0xFFto a space. An emoji printed in that state became a blank, and since its width still came from the original codepoint (a two-column one), so the rest of the row shifted too.A designated set only applies to the range it is invoked into: G0 is invoked into GL (
0x21–0x7E), so codepoints outside it should pass through unchanged (DEC STD 070, following ISO 2022 - I checked and xterm behaves the same way). Ghostty's charset tables already only remap codepoints in GL, soprintCellnow prints anything above0xFFas is instead of replacing it with a space.To reproduce, run this inside a current build:
Old

New

AI disclosure: Created with help from Claude Code using Opus 5.5. Iterated on, manually tested, and reviewed by me.