claude-code - 💡(How to fix) Fix [BUG] History recall via up arrow renders corrupted text when agent is active [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#54783Fetched 2026-04-30 06:36:08
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1
RAW_BUFFERClick to expand / collapse

Environment

  • OS: Windows 11 Enterprise
  • Terminal: Windows Terminal
  • PowerShell: 7.6.1
  • Claude Code version: TBD (check with claude --version)

Describe the bug

When using the up arrow key to recall a previous prompt from history while an agent is running or has recently completed, the recalled prompt text displays as corrupted/garbled characters in the input area. The text in history.jsonl is stored correctly — the corruption is a rendering artifact only.

Additionally, agent status lines (e.g. * Baked for 16siple days?, * Gusting...) appear overlapping the recalled prompt text in the same terminal area, suggesting the input recall and agent status output are painting to the same terminal region simultaneously.

Steps to reproduce

  1. Start a session and send several prompts
  2. Spawn a subagent (e.g. via Agent tool)
  3. While the agent is running or just after it completes, press the up arrow key to recall a previous prompt
  4. Observe the recalled text in the input area

Expected behavior

The recalled prompt text displays cleanly in the input area, matching what was originally typed.

Actual behavior

The recalled text displays with garbled/concatenated characters. Agent status lines overlap the input area.

Additional context

The history file stores the original prompt verbatim and correctly — confirmed by reading history.jsonl directly. The issue is isolated to terminal rendering during history recall.

Related open issue: #52866 (terminal re-render during sequential tool calls) appears to be in the same rendering area but a different trigger.

Duplicate scrub

The GitHub bot flagged 3 potentially related issues. Upon review none are exact matches:

  • #1509 — Closest match. Same symptom (random characters in input area while agent running) but reported on MacOS/iTerm2. Missing the specific trigger (history recall via up arrow) and steps to reproduce. Our report adds Windows/PowerShell 7.6.1 context and identifies the exact trigger.
  • #19637 — Related but different. Windows cmd.exe garbled rendering introduced in v2.1.3-v2.1.5. Broader UI rendering issue, not specific to the input/history area.
  • #43571 — Different trigger, same rendering layer. Concurrent background agents corrupting status lines. Same underlying terminal rendering problem but a different cause.

This report is specific to the history recall + agent status overlap on Windows and is not a duplicate of any of the above.

extent analysis

TL;DR

The issue can be mitigated by improving terminal rendering synchronization, potentially through adjustments to how agent status updates are handled during input recall.

Guidance

  • Investigate the rendering logic for agent status lines and input recall to identify where the overlap is occurring and how to prevent it.
  • Consider implementing a mechanism to temporarily pause or defer agent status updates while input recall is in progress to prevent overlap.
  • Review the related issue #52866, as it may share a common root cause related to terminal re-rendering during sequential tool calls.
  • Verify that the issue persists across different terminal configurations and Claude Code versions to isolate the problem further.

Example

No specific code snippet can be provided without more details on the rendering logic, but a potential approach might involve using a locking mechanism to synchronize access to the terminal input area.

Notes

The issue seems specific to the combination of Windows 11 Enterprise, PowerShell 7.6.1, and the Claude Code version in use. Further investigation into the terminal rendering and input handling code is necessary to provide a definitive fix.

Recommendation

Apply a workaround by modifying the agent status update logic to avoid overlapping with input recall, as the root cause appears to be related to terminal rendering synchronization rather than a straightforward version fix.

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…

FAQ

Expected behavior

The recalled prompt text displays cleanly in the input area, matching what was originally typed.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] History recall via up arrow renders corrupted text when agent is active [1 comments, 2 participants]