[BUG] Windows: copy-on-select (OSC 52) never reaches RDP clipboard redirection under delegated system conhost

Open 💬 2 comments Opened Jun 11, 2026 by zachthedev

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?

  • Version: 2.1.173
  • OS: Windows 11 Pro 10.0.26200
  • Terminal: Windows Terminal 1.24.11321.0

Copy-on-select emits OSC 52; the ConPTY host performs the clipboard write. When that host is the system conhost.exe (shell launched from Explorer/Run, delegated into a WT tab), the write lands on the local clipboard but is never picked up by mstsc clipboard redirection. When the host is WT's OpenConsole.exe (tab spawned inside WT), the same copy syncs fine.

Repro, same machine, same WT window, same RDP session:

  1. Connect via mstsc with clipboard redirection; verify channel (Notepad copy → remote paste OK).
  2. Tab spawned inside WT → drag-select in Claude Code → remote paste OK.
  3. Shell launched from Explorer (delegated conhost) → drag-select → local paste OK, Win+V shows entry, remote paste empty/stale. Control Set-Clipboard writes sync before and after.

Failing-write fingerprint: only CF_UNICODETEXT + synthesized CF_TEXT (no CF_LOCALE/CF_OEMTEXT synthesis); GetClipboardOwner() = NULL; content correct locally.

Upstream bug is in the in-box conhost OSC 52 implementation. I attempted to file it against microsoft/terminal, but issue creation was rejected: the repo currently restricts interactions to prior contributors. I'll retry and cross-link once the restriction lifts; regardless, an OS servicing fix for conhost would take a long time to reach users, so a Claude Code-side fix is worth doing.

Related: #41954 (selection re-copies every render, amplifying the broken write).

What Should Happen?

TUI copies reach RDP redirection regardless of console host. Suggested fix: on win32 local sessions, use a native clipboard write (the /copy path) instead of OSC 52; OSC 52 is only needed when the clipboard is remote (SSH).

Workaround: launch Claude Code from a tab opened inside WT; claude --resume to migrate an existing session.

View original on GitHub ↗

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