Files
MeshTerm/tests
Jean-Pierre MartineauandClaude Opus 4.8 c155aa4216 Chat ragged border: narrow a curated allowlist of lone emoji
The residual after the erase_down smear fix: a chat row with a lone emoji
like 👋 framed a column short, its right border notched in with a blank
beside it. Root cause is the same three-party width disagreement — Rich and
prompt_toolkit both measure 👋 as two cells, the renderer draws it in one —
but for a lone codepoint (no VS16 selector) the existing emoji_width fix
didn't reach it: that path only stops Rich promoting a narrow base, and 👋's
base is already wide.

There is no rule that separates the lone emoji this terminal draws narrow
(👋) from the ones it draws wide (📡, 💬, the menu icons): the split is the
font's glyph, not the codepoint, and it can't be probed (a cursor probe
reads the PTY, not the renderer). So this is a curated allowlist — seeded
with the one confirmed glyph, extended without a code change through
MESHTERM_NARROW_EMOJI (empty string turns it off). It only engages once the
renderer is judged to draw emoji narrow, so a wide-drawing terminal is left
untouched and nothing regresses; an unlisted narrow emoji is no worse than
before (the erase_down repaint still covers its smear).

Because it's prompt_toolkit that places the panel border, a lone-emoji
correction patches both width authorities (its _CHAR_SIZES_CACHE and Rich's
_cell_len), where the VS16 fix only needed Rich. With 👋 measured one cell
everywhere it also stops tripping _has_wide_glyph, so a 👋-only frame keeps
the fast differential paint instead of forcing a full repaint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 00:22:18 -04:00
..