[BUG] Default TUI renderer leaves ~80% viewport blank above response; fixed by /tui no-op redraw

Resolved 💬 3 comments Opened Apr 24, 2026 by KCW89 Closed May 28, 2026

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_Terminal v466 (macOS default Terminal.app)
  • TERM=xterm-256color
  • Renderer: /tui reports default (not fullscreen)

Reproduction

  1. Start a Claude Code session in Terminal.app on macOS
  2. Produce a long response (multiple paragraphs + lists + insight blocks) that ends with a 2-column markdown table where both columns wrap across multiple lines
  3. 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
  • /tui triggers a forced full-redraw as a side effect of its mode-switch logic, bypassing the broken incremental path

Workarounds

  1. /tui default (or /tui fullscreen) — even a no-op toggle forces a full redraw and fixes it
  2. Resize the terminal window — also forces a redraw
  3. 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

View original on GitHub ↗

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