claude-code - 💡(How to fix) Fix [BUG] Default TUI renderer leaves ~80% viewport blank above response; fixed by /tui no-op redraw [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52731Fetched 2026-04-24 10:41:09
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2referenced ×1

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.

Root Cause

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.

Fix Action

Fix / Workaround

Workarounds

RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

The issue can be temporarily fixed by running /tui default or resizing the terminal window to force a full redraw, suggesting a problem with the incremental render and viewport-tracking path.

Guidance

  • The problem seems to be related to the calculation of viewport height, possibly over-reserving lines for text wrapping in markdown tables.
  • Running /tui default or /tui fullscreen forces a full redraw and fixes the issue, indicating that the content emission path is correct.
  • Resizing the terminal window or using Ctrl+L also forces a redraw and can mitigate the issue.
  • The fact that scrolling up reveals the missing content in scrollback suggests that the issue is with the rendering, not the data itself.

Example

No code snippet is provided as the issue seems to be related to the rendering and viewport-tracking logic, which is not explicitly shown in the issue body.

Notes

The issue is specific to the default TUI renderer and seems to be triggered by long responses ending with markdown tables. The provided workarounds can help mitigate the issue, but a proper fix would require addressing the underlying calculation problem.

Recommendation

Apply workaround: Run /tui default or resize the terminal window to force a full redraw, as this has been shown to temporarily fix the issue. This is a safe and effective way to mitigate the problem until a more permanent solution is found.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Default TUI renderer leaves ~80% viewport blank above response; fixed by /tui no-op redraw [2 comments, 2 participants]