[Bug] Country flag emojis render as separate regional-indicator letter tiles in TUI (macOS, Ghostty)
Summary
Country flag emojis (regional indicator pairs, e.g. ๐ฏ๐ต ๐บ๐ธ ๐ฎ๐ฉ) render as their two underlying letter tiles ("JP", "US", "ID") inside the Claude Code TUI, even though the same codepoints render correctly as flags elsewhere in the same terminal.
This appears to be a string-width / grapheme-clustering issue in Ink's handling of regional indicator sequences โ the two codepoints are being treated as separate graphemes instead of a single width-2 flag cluster, so the terminal renders them individually and skips the OpenType flag ligature.
Distinct from #46805, which is a crash (API 500 on surrogate pairs in history). This is a pure rendering bug โ no crash, just wrong pixels.
Environment
- Claude Code: 2.1.119
- OS: macOS 26.3.1 (Apple Silicon)
- Terminal: Ghostty 1.3.1
- Shell: zsh
Repro
- In a Claude Code session, send or have Claude echo a message containing
๐ฏ๐ต ๐บ๐ธ ๐ฎ๐ฉ ๐ฌ๐ง - Observe: they appear as letter-pair tiles ("JP", "US", "ID", "GB")
- Quit Claude Code, at the zsh prompt run
echo ๐ฏ๐ต ๐บ๐ธ ๐ฎ๐ฉ ๐ฌ๐งโ flags render correctly
Expected
Flags render as flags in the TUI, matching the host terminal's rendering of the same codepoints.
Why this matters
Regional indicator sequences are a first-class emoji category (Unicode 6.0). For anyone using flag emojis semantically โ e.g. geographic tagging in a note/project ontology โ the TUI becomes unreadable for their tags while every other surface (Obsidian, browser, system-wide) works fine.
Likely cause
string-width / grapheme-splitting logic isn't collapsing RI+RI into a single cluster consistently. Ink then emits the two codepoints with positioning that breaks the terminal's ligature opportunity. References: past related issues #30471, #23878.
This issue has 1 comment on GitHub. Read the full discussion on GitHub โ