TUI leaks repeated fragments of current screen into terminal scrollback during a session, with rendering artifacts
Description
During an active Claude Code session, the host terminal's scrollback is being polluted with many repeated fragments of the currently visible TUI screen, sometimes accompanied by visual artifacts (stray escape sequences, broken box-drawing characters, partial lines).
The TUI itself renders correctly on the alternate screen, but as the session progresses the terminal's main-buffer scrollback accumulates dozens of near-duplicate snapshots of the last redraw, so scrolling up at any point during the session shows a long trail of repeated UI fragments instead of a clean transcript.
Expected: either the alternate screen buffer fully contains the TUI and nothing leaks into scrollback, or only a clean linear transcript (user input + assistant output) is appended.
Steps to reproduce
- Run
claudein iTerm2 on macOS. - Use the session normally — type prompts, let assistant stream output, run tool calls so the status line updates.
- While still in the session, scroll up in the terminal.
- The scrollback contains many repeated fragments of the last visible screen, with occasional artifact characters interspersed.
Environment
- Claude Code: 2.1.119
- Terminal: iTerm2 3.6.10
- TERM: xterm-256color
- OS: macOS 15.7.5 (24G624)
Notes
Related but distinct from #1913 (in-session flickering) and #42258 (Windows Terminal streaming) — here the in-session rendering looks fine, the problem is that frequent redraws are leaking into the main-buffer scrollback rather than staying confined to the alternate screen.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗