5 ms·
Why Ctrl+V won't paste images in Claude Code on WSL, with a fix
- rajveerb 4mo agotl;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 https://github.com/rajveerb/wsl-clip-bridge
- jadar 4mo agoThe last "When this stops being needed" needs one amendment: "Or stop using Windows."
- TZubiri 4mo agoNot 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.
- TurdF3rguson 4mo agoSo basically don't use Claude Code is your suggestion. Not very helpful, guy.
- TZubiri 4mo agopass 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.
- TurdF3rguson 4mo agoThe image in my clipboard doesn't have an url.
- recursive 4mo agoIt could if it was in a file, which is a thing that you control. Take charge of your destiny.
- TurdF3rguson 4mo agoRight, I could paste my clipboard which takes 1 second and zero cognitive load or I can do your suggestion 100x per day and drive myself crazy. No thanks.
- recursive 4mo agoJust have Claude vibe you up a GUI that does it in one click with only 0.1 cognitive load.
- TurdF3rguson 4mo agoThat's what Claude is, a vibe-coded GUI/TUI that you paste images and text into.
- recursive 4mo agoCool. Problem solved. Everybody wins.
- deleted 4mo ago[deleted]
- recursive 4mo agoI think you've misunderstood, guy.
- fragmede 4mo agoSixel 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.
- stronglikedan 4mo ago> Or stop using Windows I'd rather continue to be as productive as possible.
- z3c0 4mo agoNot even getting into the semantics of what one could mean by "productive", that sounds like a bleak existence.
- thewebguyd 4mo agoNot everyone here is *nix-pilled (WSL aside). Despite W11's missteps, Windows isn't a completely terrible OS to work on and has some of the best window management outside of a full tiling WM.
- 1718627440 4mo agoI doubt it, Window management has been where MS Windows has been lacking for decades, at most they have caught up. Can you do "Always on top", "Always on the bottom" yet? That's a very basic and easy to implement feature.
- thewebguyd 4mo agoAlways on top, yes (with PowerToys). But yeah you can't do "always on bottom" yet, but do able with AutoHotKey. Its still lightyears ahead of how macOS manages windows OOTB
- pjmlp 4mo agoValve could actually create a need for native Windows games. As it stands the only reason I have to pain myself back into using Linux on bare metal laptops, instead of VMs, is independence from US technologies in European soil, which also implies not having to care about Claude.
- benjaminl 4mo agoCtrl+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.
- cheema33 4mo agoI have not tried this mostly because I figured it would a resource hog and clunky. Are you describe your experience with X410 on WSL in some more detail? What are the downsides?
- sterlind 4mo agoyou do you, but I've had only good luck with WSLg. my main gripe with it is that it could be doing more. internally (part of?) WSLg uses the RDP protocol, which natively supports audio forwarding, USB passthru and smart cards. yet none of it's wired up. (disclaimer: I work at MS, not on WSL)
- rajveerb 4mo agothe post has a much simpler fix.
- bombcar 4mo agoI have the opposite problem; pasting anything moderately substantial into VSClaude ends up sending an image.
- rajveerb 4mo agoI have loads of terminal sessions in different workspaces open so I moved to using terminals as much as possible.
- jocelyner 4mo ago[dead]
- dested 4mo agoUnrelated but I have a similar problem with speech to text apps on windows, where due to the funkiness of claude codes (necessary) implementation, it doesn't send the keybindings correctly. I sure wish it didn't have to be a console app
- behnamoh 4mo agoIt doesn't work for me on macOS + ghostty either. IDK what's the cause.
- estetlinus 4mo agoTry ctrl + v https://github.com/ghostty-org/ghostty/discussions/10099#discussioncomment-15708843 https://github.com/ghostty-org/ghostty/discussions/10099#dis...
- singingtoday 4mo agoI've noticed this too. I can drag images in, but not paste.
- albert_e 4mo agoWhy are we emotionally tied to command line interfaces Desktop apps are a second class citizen that do not get feature parity Lot of actions on Claude Code seem much more suited for a thoughtfully designed GUI Even the chat responses and links therein can benefit from judicious use of rich text and formatting and real hyperlinks to other parts of the UI or elsewhere Favourite Skills can be toolbar buttons or menus if user so wishes.
- mmh0000 4mo agoUse Claude Desktop? (https://claude.com/download https://claude.com/download) Personally, I much prefer the CLI. The CLI is a tool that has been refined for over 50 years to excel at text input and output. Once you learn it, it can feel like an extension of your brain.
- hombre_fatal 4mo agoWhy did you lambast it as an emotional attachment instead of a practical preference? People prefer terminal apps because they run inside our terminal app environments (kitty, zellij, tmux), tend to be keyboard driven, tend to be more lightweight than GUIs, tend to be scriptable, and can be run remotely over a standard ssh session. A conventional GUI is a nonstarter in comparison.
- pjmlp 4mo agoI really don't get it. Started using computers when that was the only affordable way to use computers. For some reason, some people really love to live in 1970's with their expensive HiDPI monitors.
- aninteger 4mo agoAnd some of us love to live in the 1970s with cheap non-HiDPI monitors (or maybe it's just me).
- hvb2 4mo agoBecause it's all keyboard based. Depending on your field of work a good UI can be very different. A few years ago I watched an account work through my companies numbers using their accounting software. It's entry method? A windows commander like tool. The menu options like add expense etc were all numbered. So he never left the numeric part of his keyboard. The tool looked super old and obsolete but as soon as you see a power user use it, you see why.
- AgentMasterRace 4mo agoOr just last the path .. ,
- DeathArrow 4mo agoThis is still better than trying to paste text, files or images in Linux. In latest Pop!_OS I have to keep the app I copy from open until I paste. To add insult to the injury, pasting in terminal produces weird characters.
- thewebguyd 4mo agoThat sounds like a Pop!_OS specific problem, I wonder if Cosmic doesn't have a clipboard manager?
- hboon 4mo agoIf it's not working, does pasting the absolute path work? Both works on macOS.
- oezi 4mo agoWell that means saving the clipboard first.
- thehours 4mo agoOnly tangentially related, but does anyone know if it is possible to ‘paste’ images to an agent harness running inside a docker container? My current workaround is to paste it inside the working directory on the host machine, then @ reference it, but would be nice to streamline that workflow.
- oezi 4mo agoCodex CLI is doing this fine. Maybe copy a page from their book.
- mdrzn 4mo agoMy main issue was the ability to paste images when using ClaudeCode via ssh on a remote machine, so I solved it by having Claude write a quick bridge that fetches the image in your clipboard, rsync it to the server and paste the correct image path in your clipboard: https://github.com/mdrzn/claude-screenshot-uploader https://github.com/mdrzn/claude-screenshot-uploader
- jkwang 4mo ago[flagged]
- moontear 4mo agoThis is awesome! Thank you rajveerb. Here is to hoping issues from 2022 will be fixed ;-)
- rajveerb 4mo agoglad that you found it useful that was the intent.
- etbebl 4mo agoWhy would anyone assume that pasting an image into a CLI interface would work? The fact that this is framed as a bug is wild to me (but very cool that there is a way to do it now)
- cstrahan 4mo agoIIUC 1) It isn’t a matter of literally “pasting into a terminal” (with the terminal emulator shoveling bytes into the TUI’s stdin), rather it’s “a TUI key-binding tells TUI app to read system clipboard”. No different than any other app. 2) This works on macOS, Linux and Windows, but not WSL. Sounds fair game to call this a bug, or at the very least a feature disparity.