WSL2: Cannot paste image from Windows clipboard (missing PowerShell fallback)
Environment
- OS: Windows 11 + WSL2 (Ubuntu 22.04)
- Terminal: WezTerm
- Claude Code version: 2.1.90
- \
TERM_PROGRAM\: WezTerm - \
WSL_DISTRO_NAME\: Ubuntu-22.04 - \
WSL_INTEROP\: /run/WSL/344443_interop
Problem
Pasting images with \Ctrl+V\ in Claude Code does nothing on WSL2. The clipboard appears empty even after taking a Windows screenshot (Win+Shift+S).
Root Cause (traced through binary)
Claude Code's image paste logic (in \xvK()\) selects clipboard commands by platform:
- macOS → \
osascript\(works, system-native) - Linux → \
xclip -selection clipboard -t TARGETS -o\or \wl-paste -l\ - Windows → \
powershell Get-Clipboard -Format Image\
On WSL2, \process.platform\ returns \"linux"\, so it uses the Linux branch. But WSLg's clipboard bridge only syncs text formats — image data from the Windows clipboard is never passed through to the X11 clipboard. So even with \xclip\ installed, \checkImage\ finds nothing.
Verified:
\\\`bash
After taking a Windows screenshot:
$ xclip -selection clipboard -t TARGETS -o
TIMESTAMP
TARGETS
UTF8_STRING
TEXT
No image/png — WSLg dropped it
\\\`
The PowerShell code to read the Windows clipboard image already exists in the Claude Code binary for the \win32\ branch — it just never runs on WSL2.
Expected Fix
Detect WSL2 (via \WSL_INTEROP\, \WSLENV\, or \WSL_DISTRO_NAME\ env vars) and fall back to \powershell.exe\ when the Linux clipboard check finds no image.
Confirmed that \powershell.exe\ is callable from WSL2:
\\\`bash
$ powershell.exe -NoProfile -Command \
'$img = Get-Clipboard -Format Image; if ($img -ne $null) { "has image" } else { "no image" }'
Returns "no image" only because clipboard was empty at test time — the call itself works
\\\`
Reference Implementation
OpenAI Codex solved the exact same problem in openai/codex#5644:
- Detect WSL via env vars (\
WSL_INTEROP\/ \WSLENV\/ \WSL_DISTRO_NAME\) - On clipboard failure, call \
powershell.exe -NoProfile -Command\with:
\\\powershell\
$img = Get-Clipboard -Format Image
if ($img -ne $null) {
$p = [System.IO.Path]::ChangeExtension([System.IO.Path]::GetTempFileName(), 'png')
$img.Save($p, [System.Drawing.Imaging.ImageFormat]::Png)
Write-Output $p
} else { exit 1 }
\\
- Map the returned Windows path (\
C:\...\) to its WSL mount path (\/mnt/c/...\)
The fix is minimal — the PowerShell command already exists in Claude Code's \win32\ branch. It just needs a WSL detection check to route into it from the Linux path.
Showing cached comments. Read the full discussion on GitHub ↗
7 Comments
If you're developing from macOS and SSH into a WSL2 environment, clipaste v2.1.0 can help.
It runs a local HTTP server + SSH tunnel to bridge your macOS clipboard to the remote:
After setup, Ctrl+V in remote Claude Code fetches screenshots through the tunnel. No PowerShell or Windows clipboard access needed — it bypasses the Windows clipboard entirely by serving images from your Mac.
+1 — this isn't a minor inconvenience, it breaks the core CLI UX.
Pasting screenshots is table-stakes in ChatGPT, Cursor, and Claude Desktop. Having to
Win+Shift+S→ save to disk → drag/type the path turns a 1-second action into a multi-step chore that actively pushes me back to the GUI clients for any visual debugging task (UI bugs, error screenshots, design reviews, chart analysis).The whole point of a terminal-native agent is fluid, low-friction interaction. Image paste is the single biggest friction point on WSL2 right now.
The referenced fix (Codex PR openai/codex#5644) is ~30 lines and already proven in production. The PowerShell branch already exists in the Claude Code binary — it just needs a WSL detection check to route into it from the Linux path.
Please prioritize.
Hitting this on Claude Code 2.1.119 / WSL2 Ubuntu 24.04 / Windows Terminal.
Confirm: Ctrl+V with an image in the Windows clipboard does nothing in the prompt. WSLg surfaces text fine but image MIME types aren't reliably exposed to
wl-paste/xclip, so installing those doesn't help on its own.Working PowerShell-based workaround that doesn't need any apt installs (round-trips via base64 to avoid UNC-path escaping issues):
Drop it in
~/bin, add~/binto PATH, and either runclip-imagemanually before referencing the screenshot, or have the agent do it via a CLAUDE.md note like:Native Ctrl+V → image attach in the prompt would still be the right fix (matches macOS / Windows-native behavior), but this unblocks the workflow in the meantime.
issue still reproducing as of today 16/04/2026 - Claude Code version 2.1.143
Still down for me in 2.1.145 windows 11 winterm.
The problem still exists.
Same issue -- just migrated from Copilot extension and this makes it feel like a huge step backwards in productivity. Please fix soon!