Skip to content

terminal: print codepoints above 0xFF unmapped in a charset, as xterm - #14554

Merged
mitchellh merged 1 commit into
ghostty-org:mainfrom
robmorgan:charset-width
Oct 6, 2026
Merged

mitchellh merged 1 commit into
ghostty-org:mainfrom
robmorgan:charset-width

Conversation

@robmorgan

@robmorgan robmorgan commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

With a charset other than UTF-8 or ASCII designated (e.g. the DEC line-drawing set), 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 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, so printCell now prints anything above 0xFF as is instead of replacing it with a space.

To reproduce, run this inside a current build:

printf '\e(0`\U0001F600a\e(B\n'

Old
image

New
image

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

@robmorgan
robmorgan requested a review from a team as a code owner October 6, 2026 07:39
@ghostty-bot ghostty-bot Bot added the vt Control sequence related label Oct 6, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vt Control sequence related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants