MoonshotAI / MoonshotAI/kimi-cli

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

Open
#2,315 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Ctrl+V behavior in kimi_cli/ui/shell/prompt.py and kimi_cli/utils/clipboard.py, then compare it with the keyboard reference and FAQ. Done means documenting the Windows VS Code Terminal limitation and an available workaround without implying that image paste works there.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.