[Bug] Country flag emojis render as separate regional-indicator letter tiles in TUI (macOS, Ghostty)

Resolved ๐Ÿ’ฌ 1 comment Opened Apr 24, 2026 by brendobrien Closed May 28, 2026

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

  1. In a Claude Code session, send or have Claude echo a message containing ๐Ÿ‡ฏ๐Ÿ‡ต ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ฎ๐Ÿ‡ฉ ๐Ÿ‡ฌ๐Ÿ‡ง
  2. Observe: they appear as letter-pair tiles ("JP", "US", "ID", "GB")
  3. 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.

View original on GitHub โ†—

This issue has 1 comment on GitHub. Read the full discussion on GitHub โ†—