Skip to content

[Bug] Set-Clipboard leaves ownerless OLE object, stalling RDP clipboard #101676

Open

Description

@adriangrassi

Bug Description
Remote Desktop Clipboard bug: Claude Code's clipboard write via PowerShell's Set-Clipboard leaves an ownerless OLE object once the process exits, which stalls rdpclip since the owner's gone, other tools like Firefox/cmd write plain text and work fine, so RDP itself was never the issue.

Issue only happens while using claude code, it pastes nothing on the machine that launched the rdp session. Yet codex copy and paste works, browser copy and paste works, terminal/command prompt copy and paste all works via RDP except claude code. Wasted over 10% of my weekly quota to diagnose this silly bug.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal via RDP
  • Version: 2.1.296
  • Feedback ID: f93b60bc-5fb5-4a68-94cd-0267653bb8a3

Activity

  1. pablo-munoz-volue commented on Oct 28, 2026

    @pablo-munoz-volue

    Same bug here from the other direction: Claude Code 2.1.312 runs locally (Windows 11, Windows
    Terminal 1.25), and text copied from it pastes empty inside an mstsc session. I narrowed it down
    with a few scripts in plain Windows Terminal, pasting into Notepad in the RDP session each time:

    Clipboard written by RDP paste
    Windows PowerShell 5.1 Set-Clipboard alone, including the exact text Claude had copied ok
    two pwsh 7 Set-Clipboard calls back to back ok
    OSC 52 alone (Windows Terminal writes the clipboard) ok
    OSC 52, then Windows PowerShell 5.1 Set-Clipboard straight after empty

    So the OLE object on its own doesn't break RDP for me; the combination does. Claude's copy leaves
    the same clipboard formats as Windows PowerShell 5.1's Set-Clipboard (DataObject, Ole Private Data, plus text), so it looks like Claude Code sends OSC 52 and also runs powershell.exe Set-Clipboard, and rdpclip loses the second write.

    Repro of the failing case:

    $b64 = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('osc52-first'))
    Write-Host -NoNewline "`e]52;c;$b64`a"
    powershell.exe -NoProfile -Command "Set-Clipboard -Value 'winps-second'"
    # paste inside the RDP session: empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions