claude-code - 💡(How to fix) Fix [BUG] Enlarging terminal window causes duplicate Claude UI instances to stack vertically [3 comments, 3 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#46462Fetched 2026-04-11 06:19:40
View on GitHub
Comments
3
Participants
3
Timeline
8
Reactions
0
Timeline (top)
labeled ×4commented ×3cross-referenced ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Body:

Description

When resizing (enlarging) the terminal window while Claude Code is running, the TUI does not redraw in place — instead it
renders a new copy of the UI below the existing one, causing multiple stacked instances to appear on screen.

Expected Behavior

The UI should redraw in place when the terminal is resized, replacing the old layout cleanly.

Enlarging the window causes duplicate copies of the Claude Code UI to stack vertically on screen. Each resize adds another copy underneath the previous one.

Observations

  • Only occurs when enlarging the window (not confirmed on shrink)
  • Terminal correctly forwards the resize signal — stty size reports updated dimensions immediately after resize, confirming SIGWINCH propagates
  • The issue is on Claude Code's side: it does not redraw in place after receiving the signal
  • Functionally the session still works, but the visual stacking makes the interface confusing

Steps to Reproduce

  1. Open Terminal.app on macOS
  2. Start claude CLI
  3. While Claude Code is running, enlarge the terminal window
  4. Observe duplicate UI instances stacked vertically

Environment

  • OS: macOS (Darwin 25.3.0)
  • Terminal: Terminal.app
  • Shell: zsh
  • Claude Code: latest

Related

  • #16578 — similar ANSI cursor movement / redraw issue in long conversations (closed as not planned)

What Should Happen?

Expected Behavior

The UI should redraw in place when the terminal is resized, replacing the old layout cleanly.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Open Terminal.app on macOS
  2. Start claude CLI
  3. While Claude Code is running, enlarge the terminal window
  4. Observe duplicate UI instances stacked vertically

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

latest

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue can likely be fixed by properly handling the SIGWINCH signal in Claude Code to redraw the TUI in place after a terminal resize.

Guidance

  • Verify that the SIGWINCH signal is being correctly received and processed by Claude Code, as the terminal correctly forwards the resize signal.
  • Check the TUI redraw logic in Claude Code to ensure it properly clears the previous UI before drawing the new one, preventing the stacking of duplicate UI instances.
  • Investigate if there are any existing issues or pull requests related to handling terminal resizes and SIGWINCH signals in Claude Code.
  • Consider adding a debug log or print statement to track the receipt and handling of the SIGWINCH signal, as well as the TUI redraw process, to better understand where the issue lies.
  • Review the related issue #16578, although closed, to see if any insights or code changes from that issue could be applied to this problem.

Notes

The provided information suggests the issue is specific to Claude Code's handling of terminal resizes on macOS, using Terminal.app. The fact that the terminal correctly reports the updated dimensions after a resize indicates the problem is likely within Claude Code's logic for redrawing the TUI.

Recommendation

Apply a workaround by modifying Claude Code to properly handle the SIGWINCH signal and redraw the TUI in place, as this seems to be the root cause of the issue. This might involve updating the TUI library or framework used by Claude Code to correctly handle terminal resizes.

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] Enlarging terminal window causes duplicate Claude UI instances to stack vertically [3 comments, 3 participants]