Scrolling snaps to top during streaming output in iTerm2

Resolved 💬 2 comments Opened Mar 31, 2026 by ataraxiaone Closed Apr 20, 2026

Description

When reading output in a Claude Code CLI session and scrolling up while text is streaming, the viewport snaps to the top/beginning of the window. This makes it impossible to review earlier output during an active session.

Environment

  • Terminal: iTerm2 (latest, macOS Sequoia)
  • Claude Code version: 2.1.87
  • macOS: Darwin 24.6.0 (Apple Silicon)
  • Also tested with: tmux -CC (iTerm2 native integration) — same behavior

Steps to Reproduce

  1. Start a Claude Code session in iTerm2
  2. Send a prompt that generates a long response
  3. While text is streaming, scroll up to read earlier output
  4. Viewport immediately snaps away from your scroll position

What I Expected

Scroll position should remain stable while reading, even during streaming output — similar to how most terminal applications handle scrollback.

What Actually Happens

Scrolling up during streaming causes the viewport to snap to the top of the buffer, making it impossible to read earlier output until streaming completes.

Attempted Workarounds (none resolved it)

  • tmux -CC with iTerm2 native integration
  • iTerm2 Advanced → "Prevent CSI 3 J from clearing scrollback history" → Yes
  • iTerm2 Advanced → "Save scroll buffer when clearing screen" → Yes
  • Various other iTerm2 scroll-related advanced settings

Root Cause Hypothesis

Ink (React-based terminal renderer) appears to redraw the entire viewport on each token, which disrupts the terminal's scroll position. This may require changes to how Ink manages the terminal buffer during streaming.

Workaround

Plain tmux (not -CC) with Ctrl-B [ scroll mode partially works but is cumbersome.

View original on GitHub ↗

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