claude-code - 💡(How to fix) Fix Conversation content duplicates in scrollback after terminal resize (font-size / window-size) [1 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#52945Fetched 2026-04-25 06:16:31
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
1
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

When the terminal font size or window size changes during an active Claude Code session, previously-rendered conversational content is duplicated multiple times in the scrollback instead of being reflowed cleanly. The buffer becomes nearly unreadable — the same text appears stacked with offset, rather than the pre-resize render being replaced with a reflowed version.

Root Cause

When the terminal font size or window size changes during an active Claude Code session, previously-rendered conversational content is duplicated multiple times in the scrollback instead of being reflowed cleanly. The buffer becomes nearly unreadable — the same text appears stacked with offset, rather than the pre-resize render being replaced with a reflowed version.

Fix Action

Fix / Workaround

The TUI's resize/SIGWINCH handler appears to not be clearing (or overwriting) the pre-resize render before painting the reflowed version. The old render stays in scrollback alongside the reflowed render. Common class of TUI reflow bug; typically fixed by ensuring the alternate-screen buffer is fully repainted on the resize event or by emitting a clear-screen sequence as part of the handler.

RAW_BUFFERClick to expand / collapse

Description

When the terminal font size or window size changes during an active Claude Code session, previously-rendered conversational content is duplicated multiple times in the scrollback instead of being reflowed cleanly. The buffer becomes nearly unreadable — the same text appears stacked with offset, rather than the pre-resize render being replaced with a reflowed version.

Environment

  • macOS (Darwin 24.6.0)
  • Shell: zsh
  • Claude Code version: [please fill — run claude --version]
  • Terminal: [please fill — iTerm2 / Terminal.app / Warp / etc.]

Steps to reproduce

  1. Start an interactive Claude Code session and accumulate some conversational history in the buffer
  2. Change the terminal font size (e.g., ⌘ +/-) or resize the terminal window mid-session
  3. Scroll back through the buffer

Expected behavior

Existing rendered content reflows to the new column width. Each message appears exactly once.

Actual behavior

Older conversational content appears multiple times in scrollback, with each copy offset by the resize event. The screen fills with layered duplicates of the same content. See attached screenshot.

Recovery that works

  • Ctrl+L often forces a clean redraw in place
  • /clear resets the visible buffer (but discards visible recent context)
  • ⌘K (iTerm2) clears scrollback entirely

Suspected cause

The TUI's resize/SIGWINCH handler appears to not be clearing (or overwriting) the pre-resize render before painting the reflowed version. The old render stays in scrollback alongside the reflowed render. Common class of TUI reflow bug; typically fixed by ensuring the alternate-screen buffer is fully repainted on the resize event or by emitting a clear-screen sequence as part of the handler.

Screenshot

[attach via drag & drop on the GitHub issue page]

extent analysis

TL;DR

The issue can be mitigated by ensuring the alternate-screen buffer is fully repainted on the resize event or by emitting a clear-screen sequence as part of the handler.

Guidance

  • Verify that the TUI's resize/SIGWINCH handler is properly clearing the pre-resize render before painting the reflowed version.
  • Check if the issue persists when using a different terminal emulator to isolate the problem.
  • Consider adding a clear-screen sequence to the resize handler to force a clean redraw.
  • Test if the issue is specific to certain font sizes or window sizes to identify potential patterns.

Example

No code snippet is provided as the issue does not contain sufficient information about the codebase.

Notes

The provided information suggests a common class of TUI reflow bug, but without access to the code, it's difficult to provide a definitive solution. The suggested mitigations are based on the suspected cause and may require further investigation to fully resolve the issue.

Recommendation

Apply workaround: Use Ctrl+L or /clear to force a clean redraw when the issue occurs, as these commands have been reported to temporarily resolve the problem. This workaround can help mitigate the issue until a more permanent fix is implemented.

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…

FAQ

Expected behavior

Existing rendered content reflows to the new column width. Each message appears exactly once.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING