Terminal resize causes massive content duplication in scroll buffer

Resolved 💬 3 comments Opened Mar 29, 2026 by diligenceknight Closed Apr 2, 2026

Summary

When the terminal window is resized horizontally, Claude Code re-renders the entire conversation output for each resize event. Previous renders are not cleared from the scroll buffer, resulting in 10-20+ duplicated copies of the same conversation stacking up.

Steps to Reproduce

  1. Start a Claude Code session with some output (e.g., run a few tool calls)
  2. Resize the terminal window horizontally (drag the edge, or snap to different monitor)
  3. Scroll up

Expected Behavior

Only one copy of the conversation should be visible in the scroll buffer after resize.

Actual Behavior

Each resize event appends a full re-render of the conversation to the main terminal buffer. The scroll buffer fills with near-identical copies that differ only in line-wrapping width. On a multi-monitor setup where window resizing is frequent, this makes the scroll buffer essentially unusable.

Environment

  • Claude Code v2.1.86
  • Windows 11 Pro (10.0.26100)
  • Windows Terminal
  • Shell: bash

Possible Solutions

  1. Alternate screen buffer — use the alternate screen (like vim/htop) so resizes re-render in place without polluting the scroll buffer. Trade-off: scroll history is lost on exit.
  2. Debounce + clear — debounce resize events and clear the previous render before re-drawing (e.g., ANSI escape \e[2J or cursor repositioning).
  3. No re-render on resize — only re-render the active input area, leave historical output as-is in the buffer.

Additional Context

Especially painful on multi-monitor setups (4 monitors in my case) where dragging/snapping windows between screens triggers multiple resize events in rapid succession.

View original on GitHub ↗

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