Wide-table fallback leaves stale bordered paint in scroll buffer alongside the key-value re-render

Resolved 💬 4 comments Opened May 4, 2026 by ofcRS Closed Jun 12, 2026

Summary

When a markdown table is wider than the terminal can fit cleanly, the Ink renderer falls back to a vertical key-value layout (one card per row). This fallback itself is tracked separately in #44696. This issue is about the second-order bug: the failed bordered paint is not erased when the renderer switches to the card layout — it remains in the terminal's scroll buffer, so the same table appears twice in scrollback: first as a half-broken bordered ASCII table, then as the stacked key-value cards.

The result is roughly double-length output for every wide table, and the user has to scroll past a corrupted bordered render before reaching the (intended) card render.

Repro

Send any 3-column markdown table whose natural width exceeds the current Alacritty window, e.g.:

\\\markdown
| seed | DCP path | why audit dropped, why keep |
| ---- | -------- | --------------------------- |
| photo | personalInfo.selfieImageUrl | DCP has the slot; not all photo fields are file-uploads |
| github | otherSocialLinks[platform=GitHub].url | audit collapses to \"other_social_url\" — loses platform-specific routing |
| twitter | otherSocialLinks[platform=X / Twitter].url | same — keep specific |
| education_field_of_study | primaryEducation.fieldOfStudy | DCP-backed, common form field |
| education_gpa | primaryEducation.gradeValue | DCP-backed |
| education_start_date / end_date | primaryEducation dates | DCP-backed |
| skills | skillsCompetency.hardSkills | core matching field |
\
\\

Observed (see attached screenshots)

Output contains, in this order:

  1. Stale bordered ASCII table — borders do not align across rows, content overflows columns, some cells are clipped onto separate lines (e.g. twitter shows up as just itter). This is the renderer's first attempt before it gives up on the bordered layout.
  2. Stacked key-value cards — the same rows again, one block per row with three labeled lines (seed:, DCP path:, why audit dropped, why keep:). This is the intended fallback (also the subject of #44696).

Both are present in scrollback simultaneously. Resizing or new output does not clear the first paint.

Expected

When the renderer decides to fall back from the bordered layout to the card layout, it should clear/replace the failed bordered paint, not leave it in scroll history. Only one rendering of the table should be present in scrollback.

Environment

  • Claude Code: \2.1.126\
  • OS: macOS (Darwin 25.2.0, arm64)
  • Terminal: Alacritty (\TERM=alacritty\)

Related, but distinct

  • #44696 — \"Wide markdown tables collapse into stacked key-value cards\" — covers the fallback layout itself. This issue is specifically about the stale first paint that #44696 doesn't mention.
  • #52866 — \"Terminal re-renders entire conversation output repeatedly\" — different trigger (sequential tool calls), but plausibly the same family of Ink repaint/clear bug.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗