TUI relayouts (SIGWINCH / permission-mode toggle) spill entire transcript into scrollback as duplicate copies

Open 💬 15 comments Opened Apr 12, 2026 by rdmgator12

Version

  • Claude Code v2.1.101
  • macOS (Darwin 25.3.0)
  • Opus 4.6 (1M context), Claude Max
  • Standard macOS terminal

What happens

During a single Claude Code session, the entire conversation transcript is re-emitted into the terminal's primary scrollback as a fresh full copy every time the TUI relayouts. The live alt-screen pane continues to show the session correctly, but scrolling up reveals N identical copies of the session so far.

Each duplicate is the same session content — same user messages, same assistant responses, same tool calls, same tool-output line numbers, same in-progress spinner state (e.g. Wibbling… (4m 39s)) — rewrapped at a slightly different terminal column width.

Repro

  1. Start a CC session. Run a few commands that produce meaningful transcript (e.g. an MCP call, a skill launch, multi-hunk file edits with visible diffs).
  2. Trigger any of:
  • Resize the terminal window
  • Press Shift+Tab to cycle permission mode (e.g. flip to ⏵⏵ accept edits on)
  • External display connect/disconnect, full-screen toggle, Mission Control gesture — anything that fires a SIGWINCH
  1. Scroll up in the terminal.

Expected: one transcript of the session.
Actual: multiple full copies of the transcript stacked in scrollback, each at a different column width.

Evidence it's a renderer issue, not duplicate sessions

  • ps aux | grep claude shows only one live claude process
  • Each scrollback copy wraps at a different column width (e.g. ~100 → ~115 → ~130 cols) — the content is being re-laid out and re-emitted
  • Status line drifts between copies: earlier copies show 1 MCP server failed · /mcp, later copies show ⏵⏵ accept edits on (shift+tab to cycle), proving the copies were captured at different TUI states within the same session
  • The in-memory conversation the model sees is not duplicated — only the primary scrollback buffer is

Likely cause

The Ink/Yoga TUI appears to re-render the full in-scrollback conversation history on SIGWINCH or permission-mode toggle, rather than limiting the relayout to the active alt-screen pane. Each relayout flushes the entire history back into primary scrollback as a fresh block. The cost is proportional to transcript length, so it's most visible in long sessions.

Impact

Cosmetic / disorienting. The session itself continues to work correctly and the model does not see duplicated context. But scrollback becomes unusable for reviewing a long session, and on first encounter it reads like a real duplication bug — my first hypothesis was that my MCP memory layer was writing duplicate records. It wasn't; the storage was clean.

Suggested fix

  • Limit relayout to the active alt-screen pane; don't re-emit historical transcript on SIGWINCH
  • If relayout of in-scrollback history is truly necessary for correctness, do it in place via cursor addressing rather than appending to scrollback

Workarounds

  • cmd+K / clear to flush scrollback after the fact
  • Avoid resizing the terminal mid-session
  • Avoid toggling permission mode via Shift+Tab in long sessions

Happy to provide additional environment info, a recording, or a minimal repro if useful.

View original on GitHub ↗

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