Terminal scroll position resets to top on TUI re-render
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When there is a lot of output in a Claude Code session, scrolling up with the mouse to read previous content gets interrupted. The viewport jumps back to the top/bottom whenever Claude Code re-renders its display (status bar updates, new output, etc.).
This makes it very difficult to read longer outputs mid-session. The only workaround is using Shift+Up/Down or Page Up/Page Down, but mouse scrolling is the natural/expected behavior for most users.
My Environment: Linux (Ubuntu), running Claude Code directly in terminal (no tmux).
What Should Happen?
Scroll position should be preserved during TUI re-renders, or at minimum, the viewport should not jump when the user is actively scrolled up reviewing content.
Error Messages/Logs
Steps to Reproduce
- Start a Claude Code session in terminal (no tmux)
- Have a conversation that generates enough output to fill several screens (e.g., ask Claude to explain a large file or generate a long code block)
- Using the mouse wheel or trackpad, scroll up to read earlier output
- Wait a few seconds — or trigger any new output/interaction
- Observe: the viewport snaps away from where you were reading, jumping to the top of the scrollback buffer
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
v2.1.77
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Cursor
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗