[BUG] Default TUI renderer leaves ~80% viewport blank above response; fixed by /tui no-op redraw
Summary
In the default TUI renderer, a response containing a multi-row markdown table (wrapped text in both columns, following a long prose response) renders only the final 1-2 rows at the very bottom of the viewport — the rest of the screen (~80%) is blank black space. The "missing" content is correctly emitted into scrollback (confirmed by scrolling up), so this is a viewport compositor desync, not data loss.
See screenshot in the comment below.
Environment
- Claude Code:
2.1.119 - macOS: 26.3.1 (a)
- Terminal:
Apple_Terminalv466 (macOS default Terminal.app) TERM=xterm-256color- Renderer:
/tuireportsdefault(not fullscreen)
Reproduction
- Start a Claude Code session in Terminal.app on macOS
- Produce a long response (multiple paragraphs + lists + insight blocks) that ends with a 2-column markdown table where both columns wrap across multiple lines
- Observe: the final 1-2 table rows render at the bottom of the viewport; the screen above them is entirely blank black
Expected
Viewport should show the tail of the response including the lead-in prose that precedes the table, or at minimum render content from the top of the viewport downward.
Actual
~1600px-tall blank black region above the final 2-3 rendered table rows. Scrolling up via trackpad reveals the missing content is in scrollback — just not displayed in the active viewport.
Key diagnostic: /tui <current-mode> fixes it
Running /tui default when already in default (or /tui fullscreen when already in fullscreen) immediately fixes the blank-space symptom. This suggests:
- The content emission path is correct (scrollback has everything)
- The bug is in the incremental render / viewport-tracking path
/tuitriggers a forced full-redraw as a side effect of its mode-switch logic, bypassing the broken incremental path
Workarounds
/tui default(or/tui fullscreen) — even a no-op toggle forces a full redraw and fixes it- Resize the terminal window — also forces a redraw
Ctrl+L— standard clear + redraw
Hypothesis
Viewport height calculation may over-reserve lines for worst-case text wrapping on markdown tables (e.g., assuming max-column-width wrapping), then not reclaim the reserved-but-unused lines when actual wrapping is shorter. The blank region size (~80% of viewport) is suspicious — suggests a calculation scaled to the full expected response height, not just the table.
Additional context
- Auto mode was active
- Explanatory output style was active
- No unusual MCP servers or plugins beyond default Claude Code install
- Reproducible across multiple sessions when responses end with long tables
Related but distinct from
- #51828 (scrollback duplication on resize) — that's duplication, this is missing
- #51446 (diff block bg bleed in fullscreen) — that's fullscreen + color bleed, this is default + blank space
- #42010 (Ink rendering corruption during streaming) — that's mid-stream corruption, this manifests after response completes
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗