TUI viewport flickers to wrong scroll position during streaming
Description
During streaming ("Flowing..." state), the TUI viewport briefly jumps to show earlier conversation content, then snaps back to the correct position at the bottom. The entire visible area flashes with content from higher up in the conversation history for 1-2 frames before returning to normal.
Steps to reproduce
- Run Claude Code inside a tmux pane
- Have a conversation with enough history to require scrolling
- Trigger a response that includes a running Bash command (e.g., a long-running background task)
- While Claude is streaming ("Flowing..." indicator active), observe the viewport
Expected behavior
The viewport should remain pinned to the bottom of the conversation, showing the "Flowing..." indicator and input prompt.
Actual behavior
The viewport briefly (for ~0.4s) scrolls up to show earlier conversation content (e.g., file diffs, code blocks from previous messages), then snaps back to the correct bottom position. This creates a visible flicker/flash effect.
The timing seems correlated with the Bash command's "Running..." status updating (observed the running time counter incrementing from 15s to 16s across the glitch frames).
Environment
- Claude Code with Opus 4.6
- macOS (Darwin 25.2.0)
- Claude Code is running inside a tmux pane
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗