Skip to content

VS Code Integrated Terminal: Ctrl+V paste image does nothing (Windows) #2315

@VoyagerXvoyagerx

Description

@VoyagerXvoyagerx

Bug Description

In VS Code's integrated terminal on Windows, pressing Ctrl+V (or right-click Paste) after copying an image to the clipboard has no effect — no placeholder is inserted, no error is shown, and the input remains empty.

This makes it impossible to paste images into Kimi Code CLI when running inside VS Code Terminal, which is a very common workflow for developers.

Steps to Reproduce

  1. Open VS Code on Windows.
  2. Open integrated terminal (`Ctrl+``).
  3. Run kimi to start Kimi Code CLI.
  4. Copy any image to clipboard (e.g., from Snipping Tool, browser, or file explorer).
  5. Press Ctrl+V in the Kimi CLI input box.
  6. Expected: An [image:xxx.png,WxH] placeholder appears in the input box.
  7. Actual: Nothing happens. No placeholder, no text, no error message.

Environment

  • OS: Windows 10/11
  • Kimi CLI version: 1.44.0
  • Terminal: VS Code Integrated Terminal
  • Shell: PowerShell (with conda base env)

Root Cause Analysis (from source code inspection)

I inspected kimi_cli/ui/shell/prompt.py and kimi_cli/utils/clipboard.py:

  • prompt.py binds c-v to _try_paste_media() -> grab_media_from_clipboard().
  • On Windows, grab_media_from_clipboard() uses PIL.ImageGrab.grabclipboard().
  • However, VS Code's integrated terminal intercepts Ctrl+V at the terminal emulator level and only supports text paste. Binary/image clipboard data is silently dropped and never reaches the Kimi CLI keybinding handler.

So the c-v shortcut in prompt_toolkit is effectively shadowed by VS Code Terminal's own paste behavior for non-text content.

Workarounds Tried

  • Ctrl+V with image data: ❌ No reaction
  • Right-click → Paste: ❌ No reaction
  • Ctrl+O external editor (VS Code): ❌ External editor opens a temp text file; binary image data cannot be embedded, so saving does not transfer the image back to Kimi CLI.

Suggested Solutions

  1. Document this limitation in the FAQ or IDE guide, since VS Code Terminal is an extremely common environment.
  2. Consider a slash command like /attach <path> or drag-and-drop support for file paths as an alternative when running in terminals that cannot handle image paste.
  3. Enhance @ autocompletion to make it more discoverable that users can reference image files in the working directory as a substitute for clipboard paste.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions