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

Status Closed — not planned
Reported on v2.1.119
Maintainer reply None cached
Activity 2 comments · opened Apr 24, 2026 · 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 2 comments on GitHub. Read the full discussion on GitHub ↗