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

(rajveerbachkaniwala.com)

30 points | by rajveerb 2 days ago

8 comments

  • albert_e 8 minutes ago
    Why 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.

  • benjaminl 1 hour 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.
    • cheema33 25 minutes ago
      I 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 24 minutes ago
      you 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)

  • dested 24 minutes ago
    Unrelated 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

  • bombcar 51 minutes ago
    I have the opposite problem; pasting anything moderately substantial into VSClaude ends up sending an image.
  • behnamoh 15 minutes ago
    It doesn't work for me on macOS + ghostty either. IDK what's the cause.
  • rajveerb 2 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

  • jocelyner 25 minutes ago
    [dead]
  • jadar 1 hour ago
    The last "When this stops being needed" needs one amendment: "Or stop using Windows."
    • TZubiri 1 hour 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.

      • TurdF3rguson 1 hour ago
        So basically don't use Claude Code is your suggestion. Not very helpful, guy.
        • applfanboysbgon 34 minutes ago
          I think that's actually very helpful advice.
        • TZubiri 48 minutes 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.
      • fragmede 48 minutes 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.
    • stronglikedan 1 hour ago
      > Or stop using Windows

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

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