claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Windows Alt+V image paste: first press always fails, second press succeeds (v2.1.141 partial fix of #56792)

Open skoodster opened this issue 6 months ago • 3 comments

@

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

  1. Win+Shift+S -> snip a region. Clipboard now contains a Bitmap — verified at the OS level:
    pwsh -STA -NoProfile -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::ContainsImage()"
    # Returns: True
    
  2. In the Claude Code prompt, press Alt+V -> reports clipboard is empty / no image found.
  3. 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.) @

skoodster avatar May 14 '26 18:05 skoodster

+1 commenting for additional visibility

seanmartinsmith avatar May 14 '26 20:05 seanmartinsmith

+1, observing the same first Alt+V failure / second Alt+V succeeds behavior. Context: Windows + WezTerm 20240203-110809-5046fc22 + pwsh 7.6.2 + Claude Code 2.1.150. Running Claude Code inside WezTerm, after putting an image on the clipboard the first Alt+V reports no image found on the clipboard, while pressing Alt+V again immediately succeeds without changing the clipboard.

ilepn avatar May 26 '26 08:05 ilepn

Still reproducing on 2.1.153 (published 2026-05-27).

Environment:

  • Claude Code 2.1.153
  • Windows 11 Pro 10.0.26200
  • Windows Terminal + Windows PowerShell 5.1

Symptom unchanged from the report: first Alt+V press after a fresh clipboard image (Win+Shift+S snip) shows a transient "no image available" toast in the lower-right; a second Alt+V immediately after attaches the image as [Image #N]. 100% reproducible. Clipboard verified non-empty between presses via [System.Windows.Forms.Clipboard]::ContainsImage() returning True.

Note: #62279 (filed 2026-05-25 on 2.1.150, same symptom via Ctrl+V) was closed as completed on 2026-05-27 and pointed here as the duplicate, but the underlying first-press race is still present in 2.1.153.

bzamfir avatar May 28 '26 10:05 bzamfir

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] avatar Jun 29 '26 11:06 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Sep 01 '26 14:09 github-actions[bot]