WSL: text copied from Claude Code does not paste into an RDP session

Status Open
Reported on v2.1.289
Maintainer reply None cached
Activity 2 comments · opened Oct 5, 2026

Text copied in Claude Code (WSL2, VS Code terminal, fullscreen mode) pastes on the local Windows PC but not into an RDP (Windows 365 Cloud PC) session. A normal terminal copy pastes into both. Pasting into Notepad and copying again works around it.

Cause, isolated by test: on WSL, setClipboard writes the clipboard twice. It runs powershell.exe Set-Clipboard and also emits OSC 52, which VS Code writes. Each write alone pastes into RDP. Both writes about a second apart do not:

  • powershell.exe Set-Clipboard only: local OK, RDP OK
  • OSC 52 only (printf in a VS Code terminal): local OK, RDP OK
  • both, started together as Claude Code does: local OK, RDP fails

The RDP clipboard redirection most likely takes the format list from the first write, and the data is then replaced by the second write.

Suggested fix: on WSL, write once. When the terminal handles OSC 52, skip the PowerShell write, or add a setting to choose the clipboard method. The only current way to skip the native write is SSH_CONNECTION, which also changes browser and remote detection.

Versions: Claude Code 2.1.289, WSL2 kernel 6.18.35.2-microsoft-standard-WSL2, Windows PowerShell 5.1.26100, CLAUDE_CODE_NO_FLICKER=1, copyOnSelect default (on).

View original on GitHub ↗

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