[BUG] VS Code extension: Word/Excel copy pastes as PNG image instead of text (clipboard image-priority regression)

Open 💬 1 comment Opened Jun 27, 2026 by bcurtis311

Environment: macOS, Claude Code VS Code extension, version 2.1.150

Steps to reproduce:

  1. Select any text in Microsoft Word (or Excel) on macOS.
  2. Copy (Cmd+C).
  3. Paste into the Claude Code VS Code extension chat input (Cmd+V).

Expected: Text is pasted.

Actual: A PNG image of the selection is pasted instead.

Root cause (known): macOS places multiple clipboard representations on the pasteboard simultaneously when copying from Word/Excel: RTF, HTML, text/plain, AND a bitmap (TIFF/PNG) of the selection. The VS Code extension chat input's paste handler (a webview DOM paste event reading event.clipboardData) prioritizes the image representation over the text. Since image-paste support was added to the extension, any copy from a rich-text source triggers image paste. Before image-paste support, the text representation was used correctly. This is a regression.

Confirmed non-workarounds:

  • Cmd+Shift+V ("paste as plain text") has no effect in the chat panel, because the input is a webview, not a standard VS Code editor component.
  • The VS Code setting editor.pasteAs.preferredType: "text" does not reach the webview.
  • No claudeCode.* setting controls paste preference.

Only current workaround: paste into a plain-text intermediary first (TextEdit, Apple Notes, browser address bar) to strip the image, then re-copy and paste. One extra manual step on every paste.

Requested fix: When the clipboard contains BOTH an image representation AND a text/plain or text/html representation from the same copy operation, prefer text. Alternatively, ship a setting such as claudeCode.pastePreference: "text" | "image" | "auto".

Prior issue: #44604 ("Prefer plain text over image when pasting from rich text sources") was closed as not planned. This is a re-report given the everyday impact: copying text from Word/Excel is a core workflow, and silently pasting an image instead of text is surprising and disruptive.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗