Skip to content

[Bug] Auto clipboard copy in TUI prevents manual paste #22030

Closed as not planned
Closed as not planned

Description

@liu-gongjie

Description

OpenCode TUI automatically copies selected text to clipboard (likely via xclip/xsel), but this breaks manual paste functionality because:

  1. On headless servers without X11 display, xclip fails with errors
  2. Even when xclip works, the copied content cannot be pasted in OpenCode dialogs
  3. This makes it impossible to use AI-generated code/response

Environment

  • OpenCode version: TUI
  • Run on server without X11 display

Steps to reproduce

  1. Start OpenCode TUI (likely any platform)
  2. Wait for AI to generate response
  3. Try to select/copy text - it auto-copies
  4. Try to paste - nothing happens

Expected behavior

  • Allow manual copy/paste OR
  • Allow disabling auto-copy OR
  • Fix clipboard integration for server environments

Potential solution

  • Add option to disable auto-copy in config
  • Or improve clipboard handling for headless/server environments
  • Or improve error handling so it doesn't silently break

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Apr 11, 2026
  2. github-actions commented on Apr 11, 2026

    @github-actions
    Contributor

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

    If your issue is specifically about copy-on-select overwriting the clipboard and/or being unable to paste back into OpenCode, it overlaps significantly with the above. Please check if those cover your case before this is investigated further.

  3. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 4, 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