claude-code - 💡(How to fix) Fix [Bug] With autoScrollEnabled: false, viewport drifts by N lines per N new streamed lines once user prompt scrolls off-screen [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55658Fetched 2026-05-03 04:47:48
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

With autoScrollEnabled: false, the viewport stays anchored correctly while the user's prompt is still visible on screen. But once the user scrolls far enough that the prompt leaves the viewport, the displayed content drifts downward in lockstep with the streaming output — gaining one line of offset per new line generated — instead of staying pinned to the visible content.

Root Cause

With autoScrollEnabled: false, the viewport stays anchored correctly while the user's prompt is still visible on screen. But once the user scrolls far enough that the prompt leaves the viewport, the displayed content drifts downward in lockstep with the streaming output — gaining one line of offset per new line generated — instead of staying pinned to the visible content.

RAW_BUFFERClick to expand / collapse

Description

With autoScrollEnabled: false, the viewport stays anchored correctly while the user's prompt is still visible on screen. But once the user scrolls far enough that the prompt leaves the viewport, the displayed content drifts downward in lockstep with the streaming output — gaining one line of offset per new line generated — instead of staying pinned to the visible content.

Steps to Reproduce

  1. Set "autoScrollEnabled": false in ~/.claude/settings.json.
  2. Send a prompt that produces a long streaming response (≥100 lines).
  3. While Claude is still generating, scroll down so that the user prompt is no longer visible — e.g. center "Line 14" of the response in the viewport.
  4. Observe: as new lines stream in, the line in the middle of the screen advances (Line 14 → 15 → 16 → ...) instead of staying on Line 14.

Expected Behavior

With auto-scroll disabled, the viewport should stay pinned to whatever content is currently visible, regardless of whether the prompt is in frame.

Actual Behavior

Viewport drifts downward by N lines for every N new lines streamed, once the prompt is off-screen.

Environment

  • Claude Code: 2.1.118
  • macOS: 26.3.1
  • App: Claude Code desktop app (fresh launch, no project-level settings)
  • ~/.claude/settings.json has "autoScrollEnabled": false; no override in settings.local.json

extent analysis

TL;DR

The issue can be mitigated by adjusting the scrolling logic to account for the offset caused by new lines when the prompt is no longer visible.

Guidance

  • Review the scrolling logic to ensure it correctly handles the case when the prompt is scrolled out of view, potentially by introducing an offset correction based on the number of new lines added.
  • Verify that the viewport's position is updated correctly when new lines are streamed in, taking into account the user's current scroll position.
  • Consider adding a conditional check to freeze the viewport's position when the prompt is no longer visible, to prevent the drifting behavior.
  • Investigate if there are any existing configuration options or settings that could influence this behavior, such as a threshold for when to start adjusting the scroll position.

Example

No code example is provided due to the lack of specific implementation details in the issue.

Notes

The solution may require modifications to the Claude Code's scrolling logic, which could have implications for other features or user interactions. It is essential to thoroughly test any changes to ensure they do not introduce new issues.

Recommendation

Apply a workaround by adjusting the scrolling logic to correctly handle the case when the prompt is scrolled out of view, as this is likely to be a more immediate solution than waiting for a potential fix in a future version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING