[BUG] Windows Alt+V image paste: first press always fails, second press succeeds (v2.1.141 partial fix of #56792)
@
Summary
This is a follow-up to #56792 (closed as completed in v2.1.141). The 2.1.141 changelog entry — "Fixed Windows Alt+V image paste reporting no image found when the clipboard contains a screenshot" — is a real improvement, but the bug is only partially fixed. Filing fresh because #56792 is closed and repo policy blocks the original author from reopening it.
Environment
- Claude Code v2.1.141
- Windows 11 Pro 10.0.26200
- Windows Terminal + PowerShell 7
Symptom
After an image lands on the clipboard, the first Alt+V press still reports clipboard is empty / no image found. A second Alt+V press immediately after attaches the image correctly as [Image #N]. 100% reproducible.
Repro
Win+Shift+S-> snip a region. Clipboard now contains a Bitmap — verified at the OS level:
``powershell``
pwsh -STA -NoProfile -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::ContainsImage()"
# Returns: True
- In the Claude Code prompt, press Alt+V -> reports
clipboard is empty/no image found. - Press Alt+V again (clipboard unchanged) -> image attaches correctly as
[Image #N].
The clipboard contents do not change between the two presses — only the second read succeeds.
Analysis
The original decode bug from #56792 is fixed. What remains looks like a first-invocation initialization race in the clipboard reader: the first call returns "empty" before the reader is ready (cold helper process / native binding / STA thread spin-up), and the second call hits the now-warmed path. An await-on-ready, or a single retry on a cold first read, would likely close it.
Workaround
Press Alt+V twice. (Or the original #56792 workaround: save the image to disk and paste the file path.)
@
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗