claude-code - 💡(How to fix) Fix Scrollback duplication in VS Code integrated terminal (assistant messages and prompt line repeat 2-3×) [1 comments, 2 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#52547Fetched 2026-04-24 06:04:15
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

In long-running sessions inside the VS Code integrated terminal, assistant messages plus the input prompt line (>) get re-rendered 2–3 times in the scrollback. The underlying conversation is unaffected — the session JSONL contains the turn only once, so it's a pure rendering artifact.

This looks like a regression (or partial coverage) of the 2.1.116 fix:

Fixed scrollback duplication in inline mode where resizing the terminal or large output bursts would repeat earlier conversation history

Root Cause

In long-running sessions inside the VS Code integrated terminal, assistant messages plus the input prompt line (>) get re-rendered 2–3 times in the scrollback. The underlying conversation is unaffected — the session JSONL contains the turn only once, so it's a pure rendering artifact.

This looks like a regression (or partial coverage) of the 2.1.116 fix:

Fixed scrollback duplication in inline mode where resizing the terminal or large output bursts would repeat earlier conversation history

RAW_BUFFERClick to expand / collapse

Summary

In long-running sessions inside the VS Code integrated terminal, assistant messages plus the input prompt line (>) get re-rendered 2–3 times in the scrollback. The underlying conversation is unaffected — the session JSONL contains the turn only once, so it's a pure rendering artifact.

This looks like a regression (or partial coverage) of the 2.1.116 fix:

Fixed scrollback duplication in inline mode where resizing the terminal or large output bursts would repeat earlier conversation history

Environment

  • Claude Code: 2.1.118
  • macOS: 26.2 (Darwin 25.2.0)
  • VS Code: integrated terminal (latest stable)
  • Shell: zsh
  • Session: ~3h long, ~68k tokens, Opus 4.7 (1M context), "bypass permissions" mode
  • Mode indicator showed [Timeout] in the status line at the time

Repro

  1. Open VS Code integrated terminal, start claude
  2. Run a long session with a few large outputs (Bash with sizable JSON, multi-paragraph assistant replies)
  3. Let the session idle past the timeout indicator ([Timeout] appears under the model name)
  4. Continue the conversation
  5. Earlier assistant messages and the prompt line > re-appear 2–3 times in scrollback above the current turn

Cmd+K (clear terminal scrollback) makes them disappear, confirming the conversation state is correct and only the rendering is duplicated.

Expected

Each turn renders once.

Actual

Same assistant message + prompt line render 2–3× in a row.

Notes

  • Not reproducible in non-VS-Code terminals (have not yet verified — will update if I test iTerm/Ghostty)
  • Appears to be triggered after [Timeout] re-entry into the session, possibly combined with large output bursts
  • Session journal (~/.claude/projects/.../*.jsonl) shows the turn exactly once

extent analysis

TL;DR

The issue can be temporarily mitigated by using Cmd+K to clear the terminal scrollback, which confirms the conversation state is correct and only the rendering is duplicated.

Guidance

  • Verify that the issue is specific to the VS Code integrated terminal by testing in other terminals like iTerm or Ghostty.
  • Check if the problem occurs without the "bypass permissions" mode to see if it's related to this specific configuration.
  • Investigate if the issue is triggered by the [Timeout] indicator or the large output bursts, or a combination of both, by testing with smaller outputs or without idle timeouts.
  • Review the differences between the current version (2.1.118) and the previous fix (2.1.116) to understand if the regression is related to changes in the rendering logic.

Example

No specific code snippet is provided as the issue seems to be related to the rendering in the VS Code integrated terminal.

Notes

The issue might be specific to the combination of the VS Code integrated terminal, the "bypass permissions" mode, and the [Timeout] indicator. Further testing is needed to confirm the root cause.

Recommendation

Apply workaround: Use Cmd+K to clear the terminal scrollback when the duplication occurs, as it confirms the conversation state is correct and only the rendering is duplicated. This is a temporary solution until the root cause is identified and fixed.

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