Statusline corrupts on redraw with double-width Nerd Font glyphs (plane-15 / ≥ U+F0000 undercounted as 1 cell)

Open 💬 0 comments Opened Jun 11, 2026 by pottekkat

Summary

Custom statuslines that include Nerd Font "Material Design" glyphs (Unicode plane 15, codepoints ≥ U+F0000) get corrupted on redraw — mid-line character substitution, stale fragments left behind, and (with multi-line statuslines) doubled/overlapping rows. The corruption tracks the frequently-updating line (rate limits / token counts), because it redraws most often.

Root cause

Nerd Fonts render plane-15 Material Design glyphs as double-width (2 cells). The width function Claude Code uses for statusline layout (string-width / east-asian-width, which classifies these PUA/plane-15 codepoints as Ambiguous → 1 cell) undercounts each such glyph by one cell.

Each undercounted icon shifts the rest of that line left by one column relative to Claude Code's internal model of the row. On the next in-place redraw the column/row math is off, so it overwrites the wrong cells and/or fails to clear wrapped remainder. With a multi-line statusline the row-height undercount makes whole lines double up (see screenshots in linked discussion).

Confirmed it is not the terminal's ambiguous-width setting: reproduced in iTerm2 with Ambiguous Double Width = 0. Single-width Nerd Font glyphs (low BMP PUA, e.g. U+E725, U+F07B) in the same statusline never corrupt; only the ≥ U+F0000 ones do. Replacing every plane-15 icon with a single-width equivalent (< U+F0000) eliminates the corruption entirely.

Reproduction

  1. Use a custom statusLine command whose output includes a plane-15 Nerd Font glyph, e.g. U+F16A1 (md robot) or U+F051F (md hourglass), in a NerdFont-patched terminal font.
  2. Put it on a line whose values change every render (token counts, rate-limit %).
  3. Type / let the statusline update a few times.

Expected: statusline redraws cleanly. Actual: characters after the wide glyph get substituted/garbled (e.g. 5 Hour:5 H8ur:), stale fragments from prior frames remain, and multi-line statuslines render doubled.

Suggested fix

Use a width function that knows Nerd Font double-width ranges (or expose the resolved column width Claude Code assumes so scripts can compensate). Treating plane-15 PUA as width 2 — matching how Nerd Fonts render them — would fix it. (Related: #52125 requested terminal width in the statusLine payload.)

Environment

  • Platform: macOS (darwin), iTerm2, Ambiguous Double Width = 0
  • Multi-line custom statusline (bash), Nerd Font patched terminal font

View original on GitHub ↗