GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Copy and Paste behaviour under Linux · Issue #4754 · anomalyco/opencode

Copy and Paste behaviour under Linux #4754

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Copy and Paste behaviour under Linux#4754
Copy link
Assignees
kommander

Description

@astrolox
astrolox
opened on Nov 25, 2025
Issue body actions

Description

Background

You might be aware that Linux famously has two copy and paste buffers. It's a bit annoying but generally speaking I'm used to it.

I can paste into my terminal using my mouse in one of two ways;

  • I can middle click and paste automatically happens (call this buffer 1)
  • I can right click and select paste from the menu (call this buffer 2)

As you can see each of these two ways uses a different buffer.

First issue

Because OpenCode does something to disable my right click menu; I am unable to paste from buffer 2 into OpenCode.

It's a bit annoying. I've found myself having to paste things into a GUI text editor from buffer 2, then copy them into buffer 1 so I can middle click paste them into opencode. It's a lot of extra clicks just to copy and paste.

Second issue

When highlight text, it is automatically copied to my clipboard.

Linux already has this feature built in.. By default when I highlight things in my terminal they are automatically copied in to buffer 1.

Open Code actually copies the text into buffer 2.
On the face of it, it's not a big issue because every other app lets me paste from either buffer.

However when I want to copy from OpenCode and then paste back into OpenCode, because I'm trying to repeat back a small bit of text ... I can't, because the copy goes into buffer 2, and I'm only able to paste from buffer 1.

Suggested Fix

I wonder if perhaps we could not disable the right click menu?
Or perhaps there could be an option to disable the mouse integration? I never use that anyway.

Alternatively; change how the copy and paste works. I don't know enough to make suggestions around that however.

OpenCode version

v0.1.50 (currently the latest)

Terminal

Tillix and tmux

Reacted by Pavel Snajdr, Mauricio Scheffer, Darko Luketic, Chad Hirsch, Christopher Carroll Smith, Gardner Bickford, Steve Schmerler, UncleJS, Oliver Valls, dennisaschmidt and 8 more

Activity

  1. astrolox
    added
    bugSomething isn't working
    on Nov 25, 2025
  2. github-actions commented on Nov 25, 2025

    @github-actions
    github-actionsBot
    on Nov 25, 2025 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: On Linux/Wayland allow pasting with middle click #3684: [FEATURE]: On Linux/Wayland allow pasting with middle click
    • I can't paste text with CTRL+V or right mouse click when running inside WSL #3081: I can't paste text with CTRL+V or right mouse click when running inside WSL
    • selection clipboard integration in linux #943: selection clipboard integration in linux
    • Copy to clipboard is not working on Pop-os #2413: Copy to clipboard is not working on Pop-os
    • How to disable text selection and clipboard overrides? #2845: How to disable text selection and clipboard overrides?
    • [FEATURE]: Add config option to disable copy-on-select #4751: [FEATURE]: Add config option to disable copy-on-select
    • bug: opencode kills ghostty clipborad on copy from opencode #1771: bug: opencode kills ghostty clipborad on copy from opencode

    Feel free to ignore if none of these address your specific case.

    Reacted by Brian Wojtczak and Kyle Baker
  3. astrolox commented on Nov 26, 2025

    @astrolox
    astrolox
    on Nov 26, 2025
    Author
    More actions

    Not an exact duplicate of any of those; but they are all relevant in some way.

  4. rekram1-node
    added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 26, 2025
  5. rekram1-node commented on Nov 26, 2025

    @rekram1-node
    rekram1-node
    on Nov 26, 2025
    Member
    More actions

    @astrolox could we mark this as a dup of #3684?

    Seems like they are asking for same thing since u said:

    I wonder if perhaps we could not disable the right click menu?

    I don't think it's a matter of us disabling it I think it's just that since this is a TUI unlike some other tools, we need to implement some of these behaviors ourselves instead of being able to rely on your terminal taking care of it for us

  6. atkr commented on Nov 26, 2025

    @atkr
    atkr
    on Nov 26, 2025
    More actions

    @astrolox parcellite can be quite useful if you are annoyed of having 2 separate buffers (it can automatically sync them and avoid the annoyance you described in the original comment) - I've been using it for 15+ years 😄

  7. astrolox commented on Nov 26, 2025

    @astrolox
    astrolox
    on Nov 26, 2025
    Author
    More actions

    I don't really know what the best solution is. I wanted to convey the problem specifically rather than a solution because you may know better than I.

    The easiest thing would be the ability to disable mouse integration and let the terminal just handle all mouse interactions. In that way it is a duplicate.

    For example copy text into the same buffer which you allow me to paste from. In that way my problem goes away and your tool is consistent with the default terminal behaviour. However I have no idea if that's even possible for you.

    Implementing your own right click menu might be another avenue but would be a large task if done just for this problem.

  8. astrolox commented on Nov 26, 2025

    @astrolox
    astrolox
    on Nov 26, 2025
    Author
    More actions

    parcellite can be quite useful if you are annoyed of having 2 separate buffers

    I quite like having 2 now I'm used to it. However I need them to work consistently across multiple applications. That's really the crux of my bug report, opencode is inconsistent with everything else on my desktop in this regard.

    Reacted by Marno, Matt Mundell and Kyle Baker
  9. rekram1-node
    assigned
    kommander
    on Dec 1, 2025
  10. aarongrtech
    added a commit that references this issue on Dec 29, 2025

    feat(tui): add disable_mouse option for Linux right-click paste support

    This issue will close once commit acd3985 is merged into the 'dev' branch.
    acd3985
  11. tbaumann commented on Jan 9, 2026

    @tbaumann
    tbaumann
    on Jan 9, 2026
    More actions

    I really can't use this software if it's intentionally breaking my setup.

    Proper copy and paste works in my terminal. (Select to copy, middle click to insert) This app broke this absolutely needlessly.

    Reacted by Zoff, Gert Burger, Jeremy Akers, Chad Hirsch, Marno, lsh-0, M B, TangerineNightmare and Matt Woodson
  12. erwinzierler commented on Jan 17, 2026

    @erwinzierler
    erwinzierler
    on Jan 17, 2026
    More actions

    I am getting really frustrated too with the copy & paste behavior. I have followed the instructions in https://opencode.ai/docs/troubleshooting/#copypaste-not-working-on-linux and read https://opencode.ai/docs/keybinds/ but so far I have not been able to copy text into opencode. What's really funny is: pasting an image that's in my buffer works just fine with Ctrl+v. After reading this whole thread and a few more I am wondering if there are any plans to get this sorted out finally? I'd really hate having to give up this great tool just because basic functionality is missing.

    Reacted by summerjch, Gert Burger, Michał Nowakowski, Marno, Oliver Valls, M B and TangerineNightmare
  13. jeremyakers commented on Jan 24, 2026

    @jeremyakers
    jeremyakers
    on Jan 24, 2026
    More actions

    How do you screw up something as basic as copy paste in a CLI tool?

    Why do you disable the right click context menu at all? Plenty of other "visual" CLI tools work just fine with the bog standard copy paste options.

    Looking at: https://opencode.ai/docs/troubleshooting/#copypaste-not-working-on-linux

    Are you really telling me I have to run:

    Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
    export DISPLAY=:99.0
    

    If I want copy paste over an SSH connection?

    in 30 years of developing on Linux environments I have never had to install and run a separate daemon for something as basic as copy paste.

    Reacted by Marno, Jaden, M B, TangerineNightmare and Eric Johnson
  14. MichaelBrenden commented on Mar 9, 2026

    @MichaelBrenden
    MichaelBrenden
    on Mar 9, 2026
    More actions

    It is the most bizarre UI behavior I've ever seen, including across EAGLE PCB and PROTEL DOS; otherwise, the cli tool is stellar.

    Reacted by TangerineNightmare and Eric Johnson
  15. buzz commented on Mar 9, 2026

    @buzz
    buzz
    on Mar 9, 2026
    More actions

    Pasting didn't work at all for me in OpenCode (using the kitty terminal emulator).

    I dug into the code and noticed that OpenCode only handles image pasting internally. See the input_paste action. It silently ignores any pasted text.

    It's a bit confusing that the action is called input_paste even though it doesn't paste text. Something like input_image_paste might be clearer…

    As far as I can tell, text pasting is left entirely to the terminal emulator.

    So I configured kitty.conf like this (you need to adapt this to the terminal emulator you're using):

    # paste from system clipboard (and still send the key)
    map ctrl+y combine : send_key ctrl+y : paste_from_clipboard
    

    With this setup, kitty pastes the clipboard text while OpenCode still receives the key event, so image pasting continues to work. Note that I have this in my tui.jsonc:

      "keybinds": {
        "input_paste": "ctrl+y",
      },

    It might be worth updating the Copy/paste not working on Linux and/or Keybinds sections. There are quite a few copy/paste related issues in the tracker, so clarifying this could save others from having to read the code to understand what's going on.

  16. erwinzierler commented on Mar 26, 2026

    @erwinzierler
    erwinzierler
    on Mar 26, 2026
    More actions

    Thanks for this - it helped me to get copy/paste working for text in Ghostty.
    What I did:

    Open (or create) ~/.config/ghostty/config
    Add the line: keybind = unconsumed:ctrl+y=paste_from_clipboard
    Restart Ghostty (config changes require a restart)
    Make sure your tui.jsonc has "input_paste": "ctrl+y"

    After this, hitting ctrl+y in OpenCode will:

    Trigger Ghostty to paste your clipboard text into the terminal input
    Still send the ctrl+y key event to OpenCode so image pasting keeps working

    The unconsumed: prefix is the Ghostty-specific equivalent of kitty's combine chaining — worth knowing for any other keybinds you want to share between Ghostty and the app running inside it.

  17. astrolox commented on Apr 1, 2026

    @astrolox
    astrolox
    on Apr 1, 2026
    Author
    More actions

    I dug into the code and noticed that OpenCode only handles image pasting internally. See the input_paste action. It silently ignores any pasted text.

    So, perhaps someone could just update opencode to not ignore the pasted text? and that would solve all the issues?

    Reacted by Pedro de Carvalho
  18. TangerineNightmare commented on Apr 11, 2026

    @TangerineNightmare
    TangerineNightmare
    on Apr 11, 2026
    More actions

    I found this issue after hitting the same wall.. I cannot cut and paste from OpenCode like every other Linux/Unix cli software under the sun. Why is this broken? please fix. What's more when I select the text it says "copied to clipboard"... but apparently some special OpenCode clipboard that normal Linux tools arent allowed to access.

    Reacted by Eric Johnson and Rei
  19. astrolox commented on Apr 11, 2026

    @astrolox
    astrolox
    on Apr 11, 2026
    Author
    More actions

    apparently some special OpenCode clipboard

    You can paste from this clipboard using Ctrl+V on your keyboard (but you can not paste from it by using the mouse).

  20. thdxr
    removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  21. github-actions commented on Jul 3, 2026

    @github-actions
    github-actionsBot
    on Jul 3, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  22. github-actions
    closed this as not plannedon Jul 3, 2026
  23. kylebakerio commented on Aug 21, 2026

    @kylebakerio
    kylebakerio
    on Aug 21, 2026
    More actions

    this really is infuriating and maddening for a linux user. it's enough to consider looking for another project. absolutely love this project otherwise and use it daily, but it feels bizarrely anti-linux to block middle click pasting and highlight-second-clipboard-copy.

    #32370 <-- luckily this looks likely to be merged?

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

Metadata

Metadata

Assignees

  • @kommander
    kommander

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.