TUI corruption when session name contains a Unicode 16.0 emoji (Ghostty only)
Environment
- Claude Code on macOS (Darwin 25.5.0)
- Terminal: Ghostty
- Model: Opus 4.8 (irrelevant to the bug)
Description
Renaming a session (/rename) to a name containing a very recent emoji corrupts the TUI: the separator line and the right-aligned session-name badge get repainted multiple times at wrong positions instead of once. The screen layout drifts after every redraw. (Screenshot attached.)
Steps to reproduce
- In Ghostty, run
/rename e— the emoji is U+1FAEA "Face with Bags Under Eyes", introduced in Unicode 16.0 (2024). - Send any message.
- Observe: stacked blue separator lines and duplicated session-name badges; cursor position drifts.
Expected
Single separator line, single badge — same as with older emoji.
Actual
Repeated separator lines + stacked badges; cursor desyncs on every redraw.
Terminal-specific behavior (the key clue)
| Terminal | App | Result |
|---|---|---|
| iTerm2 | Claude Code | OK |
| Kitty | Claude Code | OK |
| Ghostty | Claude Code | Corrupted |
| Ghostty | other TUI | OK |
Only the Ghostty + Claude Code combination breaks.
Likely root cause
Width mismatch. Claude Code's column-width calculation (string-width / wcwidth table) doesn't yet classify U+1FAEA (Unicode 16.0), so it computes a different cell width than Ghostty renders. That disagreement desyncs cursor positioning during redraw. iTerm/Kitty agree with Claude Code's width table and don't corrupt; Ghostty uses different grapheme-width handling and does. Updating the bundled string-width/Unicode tables to 16.0 should fix it.
Related (same root-cause family)
- #30471 — TUI misalignment caused by string-width miscalculating emoji character width (closed/stale)
- #52651 — Country flag emojis render as separate tiles in TUI (macOS, Ghostty) (closed/stale)
This class of bug recurs with each new Unicode emoji block; pinning the width tables to the current Unicode version would address the whole family.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗