[BUG] Large terminal resize produces blank line gaps in diff/edit blocks

Resolved 💬 5 comments Opened Mar 15, 2026 by oviano Closed Apr 13, 2026

When Claude Code's terminal is resized by a large amount (e.g. 38→150 columns), blank line gaps appear below diff/edit blocks (Update(file) output) and tool use summaries. The gaps persist in scrollback and on the visible screen.

This is particularly impactful for any iOS/iPadOS terminal app using Claude Code — a simple device rotation from portrait to landscape triggers the bug every time, as the column count jumps significantly (e.g. 38→80+ columns).

Steps to reproduce

  1. Open Terminal.app (or any terminal) at a narrow width (~38 columns)
  2. Start claude and generate output containing file edits (diff blocks with line numbers)
  3. Ensure enough output to fill several screens of scrollback
  4. Resize the terminal to a wide width (~150 columns) — either by AppleScript (osascript -e 'tell application "Terminal" to set size of front window to {1400, 900}') or by dragging the window edge
  5. Observe blank line gaps below diff/edit blocks and tool use summaries

Expected

Content reflows cleanly, no blank gaps.

Actual

Runs of 10-24 blank lines appear between the end of each indented block and the next output. The block preserves its original narrow-width row count instead of reclaiming vertical space from unwrapped content.

Key observations

  • Affects indented wrapped content — diff/edit blocks with line numbers, and tool use summaries.
  • The blank \r\n sequences are present in the raw PTY output — confirmed by capturing raw bytes from the PTY master fd.
  • Reproduced in Terminal.app, SwiftTerm, and a custom forkpty wrapper — not terminal-specific.

Environment

  • Claude Code 2.1.76
  • macOS 26.3
  • Terminal.app (also reproduced in SwiftTerm)

Analysis

The TUI renderer (Ink) appears to preserve the previous render's block heights during a large resize redraw. When content that wrapped across N rows at narrow width fits on fewer rows at wide width, the remaining rows are emitted as blank \r\n padding. This suggests the yoga layout engine or Ink's diff/output logic is using stale height values for some components during the resize repaint.

Related issues

#8276, #5408, #1495, #4136, #10472

View original on GitHub ↗

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