Terminal scrolls to top when focus changes in Cursor IDE

Resolved 💬 3 comments Opened Jan 25, 2026 by seeekr Closed Feb 28, 2026

Environment

  • IDE: Cursor
  • Claude Code version: 2.1.19 (observed since at least 2.1.16)
  • Terminal: Cursor's integrated terminal

Problem

When running Claude Code in Cursor's integrated terminal, the terminal randomly scrolls all the way back to the beginning of the session. This appears to be triggered by focus state changes (switching focus between Cursor, the terminal, and Claude Code).

Observed behavior

  • The welcome/login header message appears to have two rendering variants
  • When focus changes, the header sometimes switches between these variants
  • This causes something to change at the top of the terminal output, triggering a full scroll to the top
  • Makes it impossible to work with long conversations as the view keeps jumping

Workaround

Avoid changing focus state — either keep Claude Code focused or unfocused, but don't switch between states. When unfocused, scrolling works normally and stays in position.

Expected behavior

Focus changes should not affect terminal scroll position or cause re-rendering of earlier output.

---
_This issue was filed by Claude Code on behalf of @seeekr_

View original on GitHub ↗

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