[BUG] CLAUDE_CODE_NO_FLICKER=1 clipboard mojibake still reproduces on WSL2

Resolved 💬 3 comments Opened Apr 19, 2026 by sahksas Closed Apr 22, 2026

Preflight Checklist

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

What's Wrong?

When running Claude Code inside WSL2 with CLAUDE_CODE_NO_FLICKER=1, selecting Japanese (CJK) text by mouse drag sends it via OSC 52, but the text arrives in the Windows clipboard as mojibake (UTF-8 bytes interpreted as CP932 / Shift-JIS).

Example: テスト is pasted as garbled characters (UTF-8 bytes decoded as CP932).

Issue #42417 reported the same symptom for native Windows and was closed in v2.1.97, where clipboard copy was changed to use PowerShell Set-Clipboard with UTF-8. That fix only runs when Claude Code detects itself as Windows. Inside WSL2 the process sees itself as Linux, so the platform check falls through and OSC 52 is still used — and the underlying ConPTY/UTF-8→CP932 conversion issue the original report identified is still present.

Reproduces on both Windows Terminal and the VS Code integrated terminal when they host a WSL2 session.

What Should Happen?

Japanese / CJK text selected in the TUI should land in the Windows clipboard as valid UTF-8 Unicode, regardless of whether Claude Code is running natively on Windows or inside WSL2.

Ideally, when the host OS is Windows (e.g. WSL_INTEROP / WSL_DISTRO_NAME is set), clipboard writes should route through powershell.exe Set-Clipboard (same strategy as the v2.1.97 Windows fix) instead of OSC 52, or otherwise avoid the UTF-8→CP932 conversion in the ConPTY path.

Error Messages/Logs

Status line (visible in TUI on copy):
  sent N chars via OSC 52 · check terminal clipboard settings if paste fails

No stderr / stack trace — copy silently succeeds byte-for-byte but content is mojibake.

Steps to Reproduce

  1. On Windows 11 (system code page 932 / Japanese locale), open Windows Terminal or the VS Code integrated terminal with a WSL2 (Ubuntu) profile.
  2. Inside WSL2, launch: CLAUDE_CODE_NO_FLICKER=1 claude
  3. Ask Claude to output Japanese, e.g. "テスト" とだけ出力して.
  4. Select the Japanese output by mouse drag. The status line shows sent N chars via OSC 52.
  5. Paste into Notepad (or any UTF-8-aware editor).
  6. Observed: mojibake — テスト pastes as garbled characters instead of the original Japanese (same UTF-8→CP932 decoding error described in #42417).
  7. As a cross-check, hold Shift while dragging to bypass mouse capture and use the terminal's native selection → paste is correct. Also, unsetting CLAUDE_CODE_NO_FLICKER → paste is correct.

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.114 (Claude Code)

Platform

Other

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗