claude-code - 💡(How to fix) Fix PowerShell tool calls degrade terminal UI rendering for rest of session on Windows [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#53321Fetched 2026-04-26 05:18:44
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Fix Action

Fix / Workaround

Workaround Close window → claude --continue from a fresh window. Rendering resets.

RAW_BUFFERClick to expand / collapse

Environment

  • OS: Windows 11 Pro 26200
  • Shell: Windows PowerShell 5.1 (powershell.exe — what the PowerShell tool wraps)
  • Claude Code: 2.1.119

Reproduction

  1. Open a Claude Code session (any project directory)
  2. Send a prompt that triggers a PowerShell tool call (e.g., "list connected disks via Get-Disk")
  3. Observe: the Claude Code CLI rendering subtly changes — text becomes harder to read, looks like a font-style or font-size shift
  4. Subsequent prompts and subsequent tool calls (PowerShell or other) preserve the degraded rendering for the rest of the session
  5. Closing the window and resuming via claude --continue from a new window → rendering reverts to original

Expected UI rendering remains consistent across tool calls regardless of which tool was invoked.

Actual First PowerShell tool call mutates terminal rendering for the rest of the session. Bash tool calls do not trigger this.

Hypothesis PowerShell 5.1's startup likely mutates parent-console state via Win32 APIs (e.g., SetCurrentConsoleFontEx, codepage change via chcp, or ENABLE_VIRTUAL_TERMINAL_PROCESSING console mode flag). The mutation persists at the console level — outliving the PS subshell — so subsequent rendering inside Claude Code uses the mutated state. New window = new console, hence the revert.

Workaround Close window → claude --continue from a fresh window. Rendering resets.

Notes

  • Reproducible across multiple sessions on the same machine
  • Bash tool calls (Git Bash / mintty) do NOT trigger the issue, suggesting it's specific to how the PowerShell tool spawns its subshell with respect to Windows console state

extent analysis

TL;DR

The issue can likely be fixed by resetting the console state after the PowerShell tool call, potentially by using Win32 APIs to restore the original font and console settings.

Guidance

  • Investigate the use of SetCurrentConsoleFontEx and chcp in the PowerShell tool call to understand how the console state is being modified.
  • Consider adding a step after the PowerShell tool call to reset the console state to its original settings, potentially using the same Win32 APIs.
  • Verify that the issue is specific to PowerShell 5.1 and does not occur with other tool calls, such as Bash.
  • Test the workaround of closing the window and resuming with claude --continue to confirm that it consistently resets the rendering.

Example

No code snippet is provided as the issue is related to the interaction between the PowerShell tool and the Windows console state, and the exact code changes required are not clear.

Notes

The issue appears to be specific to the combination of PowerShell 5.1 and the Windows console, and may not occur with other versions of PowerShell or on different operating systems.

Recommendation

Apply the workaround of closing the window and resuming with claude --continue until a more permanent fix can be implemented, as it consistently resets the rendering to its original state.

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