Skip to content

Terminal randomly scrolls to top and auto-scrolls to bottom during output, breaking scrollback navigation #34845

@r4d10n

Description

@r4d10n

Problem

Two related scrolling issues in the Claude Code terminal:

1. Viewport jumps to the TOP randomly, even when idle

The terminal spontaneously scrolls to the very top of the scrollback history, even when Claude is not generating output. This happens unpredictably and forces the user to scroll all the way back down to where they were reading.

2. Auto-scroll during output generation overrides manual scrolling

When Claude is actively generating output (streaming tokens or running tools), the terminal automatically scrolls to follow the latest output. This overrides any manual scrolling the user is doing.

Steps to Reproduce

Random scroll-to-top (Issue 1):

  1. Have a conversation with substantial history
  2. Scroll up to read previous output (while Claude is idle / not generating)
  3. The viewport randomly jumps to the very top of the history

Auto-scroll override (Issue 2):

  1. Start a conversation that produces long output
  2. While output is still streaming, try to scroll up to read earlier content
  3. The viewport snaps back to the bottom as new content renders

Expected Behavior

  • The viewport should never jump to the top on its own
  • Users should be able to scroll freely through history without the position being reset
  • Auto-scroll should pause when the user manually scrolls away from the bottom, and resume only when the user scrolls back to the bottom

Impact

This is a significant usability pain point. The random scroll-to-top is especially disruptive — it makes reading through conversation history unreliable and frustrating. Users lose their place constantly.

Environment

  • Platform: Linux (Manjaro)
  • Terminal: standard terminal emulator
  • Claude Code: latest version

Suggested Solution

Implement scroll position preservation:

  • Never programmatically scroll to the top
  • If the user scrolls up, lock the viewport at that position
  • Resume auto-scroll only when the user scrolls back to the bottom

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions