Skip to content

Copy Text "Copied to clipboard" does never work #7048

Closed as not planned
Closed as not planned

Description

@ambedded

Description

I cant copy text, be it in the output window or in the input window. Whenever i mark text and right click it, it always says "Copied to clipboard", and un-highlights the marked text. But it never does. Its not in the clipboard buffer.

  • Ubuntu Desktop
  • GhostTTY

Plugins

No response

OpenCode version

1.1.3

Steps to reproduce

  • Ubuntu Desktop
  • GhostTTY
  • ZSH + OMZ

Try to copy text from opencode and paste (never actually copied into clipboard buffer)

Screenshot and/or share link

No response

Operating System

Ubuntu 25.10

Terminal

GhosTTY w. zsh/OMZ

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 6, 2026
  2. github-actions commented on Jan 6, 2026

    @github-actions
    Contributor

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

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

  3. wunki commented on Jan 11, 2026

    @wunki

    This is how I got it to work. The ghostty part may help: https://petar.dev/notes/copypaste-for-opencode-with-ghostty-and-tmux/

  4. jc01rho commented on Feb 3, 2026

    @jc01rho

    here also, from 1.1.49, works good at 1.1.48

  5. castle-bravo commented on Feb 3, 2026

    @castle-bravo

    here also, from 1.1.49, works good at 1.1.48

    Can confirm. I have 1.1.48 and 1.1.49 open in different containers. I can copy from 1.1.48 but not 1.1.49.

  6. neru1234 commented on Feb 3, 2026

    @neru1234

    can't copy, 1.1.49, ubuntu 24.04.

  7. yaasin-raki2 commented on Feb 3, 2026

    @yaasin-raki2

    can't copy, 1.1.49, Macos 26.2. Iterm2

  8. jc01rho commented on Feb 4, 2026

    @jc01rho

    reinstall v1.1.51 with bun add -g opencode-ai, with tmux set -g allow-passthrough on works

  9. maxhillaert commented on Feb 10, 2026

    @maxhillaert

    reinstall v1.1.51 with bun add -g opencode-ai, with tmux set -g allow-passthrough on works

    This worked for me I was on 1.1.49

  10. iwanro commented on Feb 17, 2026

    @iwanro

    Subject: [Bug] Text not copied to clipboard despite "Copied to clipboard" notification (v1.2.4)

    Describe the bug
    I am unable to copy text from either the input or output windows. When I highlight text, the application displays a "Copied to clipboard" overlay and immediately deselects the text. However, the clipboard remains empty (the text is not present in the clipboard buffer).

    To Reproduce

    Open OpenCode 1.2.4 on Linux Mint.
    
    Select any text in the input or output window.
    
    See the "Copied to clipboard" message and the text being un-highlighted.
    
    Attempt to paste (Ctrl+V or Middle Click) in any other application. The buffer is empty or contains previous data.
    

    Environment:

    OpenCode Version: 1.2.4
    
    OS: Linux Mint
    
    Terminals tested: Mint Terminal (GNOME Terminal), Tilix.
    
    Display Server: X11 (default for Mint)
    

    Additional context
    The issue persists across different terminal emulators, suggesting it might be related to how the application interacts with the system clipboard or the primary selection in a Linux environment.

  11. VedaChen commented on Feb 20, 2026

    @VedaChen

    如果使用linux的朋友,确认你的桌面,执行命令echo $XDG_SESSION_TYPE ,如果是x11: sudo apt install xclip 如果是wayland: sudo apt install wl-clipboard,应该能够解决

  12. iwanro commented on Feb 22, 2026

    @iwanro

    如果使用linux的朋友,确认你的桌面,执行命令echo $XDG_SESSION_TYPE ,如果是x11: sudo apt install xclip 如果是wayland: sudo apt install wl-clipboard,应该能够解决

    it works! thankyou

  13. JxiaoC commented on Mar 3, 2026

    @JxiaoC

    如果使用linux的朋友,确认你的桌面,执行命令echo $XDG_SESSION_TYPE ,如果是x11: sudo apt install xclip 如果是wayland: sudo apt install wl-clipboard,应该能够解决

    nice!

  14. Ayoola commented on Mar 3, 2026

    @Ayoola

    如果使用linux的朋友,确认你的桌面,执行命令echo $XDG_SESSION_TYPE ,如果是x11: sudo apt install xclip 如果是wayland: sudo apt install wl-clipboard,应该能够解决

    感谢您提供的解决方案!我在终端中执行 echo $XDG_SESSION_TYPE,得到的结果是 tty(我是在纯 TTY 控制台下工作,而非 X11 或 Wayland)。

    请问在这种环境下应该使用什么工具或命令来实现复制/粘贴?是否有推荐的包可以安装?

    期待您的进一步指导,谢谢 @VedaChen

  15. VedaChen commented on Mar 5, 2026

    @VedaChen

    如果使用linux的朋友,确认你的桌面,执行命令echo $XDG_SESSION_TYPE ,如果是x11: sudo apt install xclip 如果是wayland: sudo apt install wl-clipboard,应该能够解决

    感谢您提供的解决方案!我在终端中执行 echo $XDG_SESSION_TYPE,得到的结果是 tty(我是在纯 TTY 控制台下工作,而非 X11 或 Wayland)。

    请问在这种环境下应该使用什么工具或命令来实现复制/粘贴?是否有推荐的包可以安装?

    期待您的进一步指导,谢谢 @VedaChen

    或许你可以尝试使用ssh工具来连接你的linux,然后ssh工具中启动opencode并复制粘贴试试?

  16. ambedded commented on Mar 17, 2026

    @ambedded
    Author

    能否把这个功能干掉,这个功能真的是bug,我都可以手动复制,非得把我选中的东西取消?

    Image 复制的地方啥都没有,你不取消我还能自己手动复制

    buddy, can you please use english so everyone can collaborate?

  17. aEgoist commented on Mar 31, 2026

    @aEgoist

    Came up with this issue too. WHY need you cancel my selection at all? I can copy by my own at the first place! T

    能否把这个功能干掉,这个功能真的是bug,我都可以手动复制,非得把我选中的东西取消?
    Image 复制的地方啥都没有,你不取消我还能自己手动复制

    buddy, can you please use english so everyone can collaborate?

    Could you get rid of this feature? It’s really a bug—I could just manually copy, but it cancels my selection instead, leaving nothing to copy? If you didn't cancel my selection, I could just copy it manually.

    Came up with this issue too. WHY need you cancel my selection at all? I can copy by my own at the first place! Totally AGREE!

  18. MoshiLL commented on Apr 13, 2026

    @MoshiLL

    Came up with this issue too. WHY need you cancel my selection at all? I can copy by my own at the first place! T

    能否把这个功能干掉,这个功能真的是bug,我都可以手动复制,非得把我选中的东西取消?
    Image 复制的地方啥都没有,你不取消我还能自己手动复制

    buddy, can you please use english so everyone can collaborate?

    Could you get rid of this feature? It’s really a bug—I could just manually copy, but it cancels my selection instead, leaving nothing to copy? If you didn't cancel my selection, I could just copy it manually.

    Came up with this issue too. WHY need you cancel my selection at all? I can copy by my own at the first place! Totally AGREE!

    yeah, i think so

  19. Cody292 commented on Apr 22, 2026

    @Cody292

    If you run opencode within tmux, tmux will intercept the OSC52 sequence by default, rendering the copy function completely ineffective.
    Solution:
    echo "set -g allow-passthrough on" >> ~/.tmux.conf
    tmux source-file ~/.tmux.conf

  20. coreybruce commented on Apr 23, 2026

    @coreybruce

    Having the same issue on Linux with konsole on KDE and xfce4 terminal on xfce4, I don't think this bug is terminal or DE/display protocol specific

  21. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  22. joelceo commented on May 20, 2026

    @joelceo

    Solution found: install xclip

    sudo apt install xclip
    My environment:

    • Ubuntu 26.04 + Ptyxis + Wayland
    • OpenCode 1.15.5
    • No multiplexers (tmux/zellij)

    Why it works: OpenCode seems to use xclip as a fallback for copying to the clipboard when OSC52 fails (which happens in certain Linux terminals with Wayland).
    Before this, auto-copy-on-select showed "Copied to clipboard" but never reached the clipboard. After installing xclip, it works perfectly.
    Note: the solution is simple and doesn't require changing terminals or disabling Wayland. Hope this helps other users with the same issue.

  23. farons commented on Jun 17, 2026

    @farons

    export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=1
    export OPENCODE_DISABLE_MOUSE=1

    You can first disable it, and then use the copy-paste function of your own tool. This will prevent the scrolling function from working.

  24. github-actions commented on Aug 17, 2026

    @github-actions
    Contributor

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

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