Back

Why Ctrl+V won't paste images in Claude Code on WSL, with a fix

24 points3 daysrajveerbachkaniwala.com
benjaminl2 hours ago

Ctrl+V paste works for me on WSL. My secret is that I have given up on WSLg and use a standalone X Windows server. Specifically, the X410 X Server. This removes a whole lot of weird behavior including the ones described by the article.

bombcar2 hours ago

I have the opposite problem; pasting anything moderately substantial into VSClaude ends up sending an image.

jadar3 hours ago

The last "When this stops being needed" needs one amendment: "Or stop using Windows."

TZubiri3 hours ago

Not a bug, pasting images into the terminal is not supported, do not do this, that's not what the terminal is for or how it is used. The standard way is to pass the path of a file to the program as a runtime parameter or in some config file.

Terminals are not alternative web browsers/graphical application sandboxes.

TurdF3rguson2 hours ago

So basically don't use Claude Code is your suggestion. Not very helpful, guy.

applfanboysbgon2 hours ago

I think that's actually very helpful advice.

TZubiri2 hours ago

pass the url (local or otherwise) of the image to Claude code. Otherwise it's not the terminal's problem, please don't pressure Microsoft to introduce an attack vector to wsl for slop's sake.

fragmede2 hours ago

Sixel came out in the 80's as a way to print on dot matrix printers. If your terminal doesn't support that yet, you might want to look into updating your software.

stronglikedan2 hours ago

> Or stop using Windows

I'd rather continue to be as productive as possible.

z3c02 hours ago

Not even getting into the semantics of what one could mean by "productive", that sounds like a bleak existence.

rajveerb3 days ago

tl;dr Use Claude Code in WSL inside Windows Terminal? Copying an image in Windows and pressing Ctrl+V in Claude Code doesn't work. Three things break: (1) WSL only hands Windows images to the Linux side in an old BMP format Claude Code can't read; (2) WSL also keeps quietly overwriting your fixes a moment later; (3) Windows Terminal grabs Ctrl+V before Claude Code can see it. The fix is a small Windows program that converts the image to PNG, a Linux script that puts it on the Linux clipboard (and re-asserts once after WSL overwrites it), and one extra keybinding for Claude Code so the keystroke actually reaches the program.

Code: https://github.com/rajveerb/wsl-clip-bridge