Scroll position resets to bottom when terminal loses focus while idle
Resolved 💬 2 comments Opened Jan 18, 2026 by jberdine Closed Jan 18, 2026
Bug Description
When Claude Code is idle (waiting for user input, e.g., at a "Would you like to proceed?" prompt), scrolling up to review previous output and then switching to another macOS window causes the scroll position to immediately reset to the bottom when the terminal loses focus.
Steps to Reproduce
- Start a Claude Code session that generates enough output to require scrolling
- Wait until Claude Code is idle (waiting for input)
- Scroll up to review previous output
- Switch to another application window (Cmd+Tab or click)
Expected: Scroll position remains where it was left
Actual: Scroll position immediately jumps to the bottom when the terminal loses focus
Environment
- Terminal: Ghostty
- Platform: macOS (Darwin 24.6.0)
- Claude Code version: 2.1.12
Notes
- This occurs when Claude Code is completely idle - no output being generated
- No terminal resize is involved
- Ghostty's
scroll-to-bottomsetting is alreadykeystroke,no-outputby default, so this appears to be caused by Claude Code's TUI layer responding to focus-out events
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗