[Bug] Clipboard write conflicts with Windows Terminal copy in RDP sessions

Status Open
Reported on v2.1.233
Maintainer reply None cached
Activity 2 comments · opened Aug 16, 2026

Bug Description
Windows: Claude Code rewrites the clipboard after the terminal has already copied, which breaks pasting into RDP sessions. Environment: Windows 11 Pro 26200.9168, Claude Code 2.1.233 (also reproduced on 2.1.232 and 2.1.228), Windows Terminal 1.24.11911.0 (copyOnSelect false), Windows PowerShell 5.1, mstsc to a Windows Server. Symptom: text selected and copied inside Claude Code cannot be pasted into an RDP session - the remote clipboard is left EMPTY, losing what was there before. Copying from an ordinary tab of the same Windows Terminal window works fine, so it is not the terminal, the RDP channel, the clipboard formats or the characters. Measured by polling GetClipboardSequenceNumber every 15 ms during one copy: 22:56:38.604 seq=335 owner=WindowsTerminal 708 B CF_UNICODETEXT, CF_LOCALE, CF_TEXT, CF_OEMTEXT 22:56:38.834 seq=346 owner=powershell 708 B + DataObject, Ole Private Data 22:56:38.880 seq=347 owner=NONE 708 B + DataObject, Ole Private Data 22:56:49.948 seq=352 owner=WindowsTerminal 370 B (plain dir copy, one state, pastes fine) Windows Terminal puts the selection on the clipboard first, in the ordinary form that crosses RDP. About 230 ms later a short-lived powershell.exe writes the same 708 bytes again with OLE formats on top, then exits. mstsc has already started transferring the first version to the server; the content is swapped underneath it, the transfer aborts, and the remote clipboard ends up empty. One write always works; two writes always fail. Workaround: hold Shift while selecting, so Windows Terminal owns the selection and Claude Code never performs its second write - then pasting into RDP works. Also fixable after the fact with: Set-Clipboard -Value (Get-Clipboard -Raw) Request: on Windows, skip Claude Code's own clipboard write when the terminal has already copied the selection, or make the second write optional.

Environment Info

  • Platform: win32
  • Terminal: null
  • Version: 2.1.232
  • Feedback ID: 24b73e48-6919-4642-ab26-b2bf8d649dab

Errors

[]

View original on GitHub ↗

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