Skip to content

feat: support pasting images from the clipboard #1429

Closed

Description

@tnthi115

It would be awesome to be able to paste images from the clipboard. Sometimes I don't want to save a screenshot to disk and then drag and drop it. Pasting copied images is super convenient.

Activity

  1. Rich107 commented on Jul 31, 2025

    @Rich107

    I was just shammed in a pairing session and had to go over to cursor.... *shudders to past in the image I screenshotted.

    Whining aside great job on opencode, loving it !

  2. adamdotdevin commented on Jul 31, 2025

    @adamdotdevin
    Member

    there's a keybind for this, default is ctrl+v, is this not working for you?

  3. dyskette commented on Aug 2, 2025

    @dyskette

    It works for me on Linux with Ptyxis (VTE). On Windows Terminal (at least WSL) it doesn't work. I tried wezterm on Linux and it works.

    Edit:

    Today I tried some combinations and found that the following happens in both Windows Terminal and wezterm:

    Scenario 1, copying an image with Windows Photos and pasting into opencode within WSL:

    1. Open an image using Windows Photos.
    2. Press ctrl+c to copy the content of the image.
    3. Launch opencode on Ubuntu 24.04 using WSL.
    4. Paste the image using ctrl+v
    5. Result: The image is not pasted at all, nothing happens.

    Scenario 2, copying an image with ImageGlass and pasting into opencode within WSL:

    1. Open an image using ImageGlass.
    2. Repeat steps 2, 3 and 4 from scenario 1
    3. Result: It shows as if some text was pasted.
    Image

    Scenario 3, taking a screenshot and pasting into opencode within WSL:

    1. Take a screenshot using Windows snipping tool, the screenshot is in the clipboard now.
    2. Launch opencode on Ubuntu 24.04 using WSL.
    3. Paste the screenshot using ctrl+v
    4. Result: The image is not recognized as such but as a giant block of text that was pasted. LLMs will reject this most of the time. And opencode will crash some time after that.
    Image Image

    Cheers.

  4. mattgillard commented on Aug 11, 2025

    @mattgillard
    Contributor

    I thought this was not working for me on mac as I was using cmd-v. ctrl-v worked!
    However for large blocks of text cmd-v works just fine. It seems it just doesn't work for images from clipboard.
    Can you pls support cmd-v as well for images for consistency?

    love the app!! Used it for a demo for a client!

  5. tnthi115 commented on Aug 11, 2025

    @tnthi115
    Author

    there's a keybind for this, default is ctrl+v, is this not working for you?

    Thanks @adamdotdevin, this is works for me. I was using cmd+v instinctively. Feel free to close this issue for the original problem.

  6. Rich107 commented on Sep 5, 2025

    @Rich107

    Whilst I am on a mac and cmd + v did fool for a bit. Its actually when running opencode i a container. I am using devpod and devcontainers to run all my lsp and interpreter config access to the database etc. So running opencode in the container is awesome as it can run all the tests etc.

    But I can't paste images into it, I can paste in text but not say something I just screen shotted. Now, if I run opencode on the host ie, right on the Mac then ctrl+v does work. But then I lose all the LSPs and the ability to run the tests.

  7. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Collaborator

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

  8. dhruvkej9 commented on Jan 5, 2026

    @dhruvkej9

    @rekram1-node We need it, still not working in WSL, we have to first save the image and then only paste works

  9. awakecoding commented on Jan 13, 2026

    @awakecoding

    I just figured it out - Windows Terminal has a key binding on ctrl+v by default, preventing it from being forwarded to OpenCode. Claude Code accepts alt+v, which isn't captured by WT. For OpenCode to accept ctrl+v, you need to delete the key binding from the Windows Terminal settings, like this:

    Image

    Under Actions, find the "Paste" entry with "ctrl+v", then delete it. ctrl+v should now work properly in OpenCode:

    Image
  10. dhruvkej9 commented on Jan 13, 2026

    @dhruvkej9

    I just figured it out - Windows Terminal has a key binding on ctrl+v by default, preventing it from being forwarded to OpenCode. Claude Code accepts alt+v, which isn't captured by WT. For OpenCode to accept ctrl+v, you need to delete the key binding from the Windows Terminal settings, like this:

    Image Under Actions, find the "Paste" entry with "ctrl+v", then delete it. ctrl+v should now work properly in OpenCode: Image

    Yea it works but then you can't paste text directly from clipboard, you can post images direct from clipboard but not text, also you have to use ctrl + shift + V then

  11. goleary commented on Jan 29, 2026

    @goleary

    why not use cmd + v like claude code?

  12. adgower commented on Feb 3, 2026

    @adgower

    any updates on this?

  13. dhruvkej9 commented on Feb 3, 2026

    @dhruvkej9

    I just figured it out - Windows Terminal has a key binding on ctrl+v by default, preventing it from being forwarded to OpenCode. Claude Code accepts alt+v, which isn't captured by WT. For OpenCode to accept ctrl+v, you need to delete the key binding from the Windows Terminal settings, like this:

    Image

    Under Actions, find the "Paste" entry with "ctrl+v", then delete it. ctrl+v should now work properly in OpenCode:

    Image

    Then you were able to paste text using ctrl + v in opencode tui ??

  14. dhruvkej9 commented on Feb 3, 2026

    @dhruvkej9

    @tnthi115 you can reopen it, not solved yet

  15. dansan92 commented on Feb 11, 2026

    @dansan92

    One option is to create a ~/.config/opencode/opencode.json and add:

    {
      "$schema": "https://opencode.ai/config.json",
      "keybinds": {
        "input_paste": "alt+v"
      }
    }

    Worked for me with WSL, now I can paste text with standard ctrl+v, and images with alt+v.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions