claude-code - 💡(How to fix) Fix [BUG] Windows VS Code terminal output becomes garbled (CJK-looking glyphs) after ~60–90 minutes of session

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…

Error Message

Error Messages/Logs

Root Cause

(Garbled output example — actual rendering shows CJK-looking glyphs instead of the intended text. Cannot paste a faithful sample because the underlying bytes are transcoded incorrectly by the time they reach the clipboard.)

Fix Action

Fix / Workaround

Workarounds tried:

  • chcp 65001 at session start: partially effective, recurs after long-running output.
  • Setting PYTHONIOENCODING=utf-8: doesn't prevent the terminal-level corruption.
  • Switching from PowerShell 5.1 to PowerShell 7: not verified yet.

Code Example

(Garbled output example — actual rendering shows CJK-looking glyphs instead of the intended text. Cannot paste a faithful sample because the underlying bytes are transcoded incorrectly by the time they reach the clipboard.)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

After approximately 60–90 minutes of a single Claude Code session in the VS Code integrated terminal on Windows 11, the terminal output starts rendering as CJK-looking glyphs — characters that look like Chinese ideograms instead of normal text. This appears to be a console code-page corruption: the Windows console seems to switch from UTF-8 (CP 65001) back to a legacy code page (CP 936 / GBK or similar) mid-session. Once the corruption begins, all subsequent terminal output is unreadable until the terminal is restarted (losing the scrollback context of the long-running session).

Workarounds tried:

  • chcp 65001 at session start: partially effective, recurs after long-running output.
  • Setting PYTHONIOENCODING=utf-8: doesn't prevent the terminal-level corruption.
  • Switching from PowerShell 5.1 to PowerShell 7: not verified yet.

What Should Happen?

Terminal output should remain in the configured encoding (UTF-8) throughout the entire Claude Code session, regardless of session length or amount of mixed-Unicode output produced.

Error Messages/Logs

(Garbled output example — actual rendering shows CJK-looking glyphs instead of the intended text. Cannot paste a faithful sample because the underlying bytes are transcoded incorrectly by the time they reach the clipboard.)

Steps to Reproduce

  1. Open VS Code on Windows 11.
  2. Start a Claude Code session in the integrated terminal (PowerShell).
  3. Work through tasks that produce mixed Unicode output — currency symbols (£, €), em-dashes (—), Greek letters in equations (ε, θ, β), accented characters from Portuguese/Spanish text, etc.
  4. After roughly 60–90 minutes of continuous session work the terminal renders all subsequent output as CJK-looking garbled glyphs.
  5. Restarting the terminal restores normal rendering.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

(please run claude --version and paste output here)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Suspected cause: Windows console code page being reset (possibly when a Python subprocess writes a different encoding, or when stdout buffer flushes mid-line). The issue is reproducible across multiple sessions on the same Windows 11 machine. Happy to provide a session transcript or run additional diagnostics on request.

Tagging this as a Windows-platform terminal-encoding bug rather than a Claude-model-behaviour bug.

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

claude-code - 💡(How to fix) Fix [BUG] Windows VS Code terminal output becomes garbled (CJK-looking glyphs) after ~60–90 minutes of session