Skip to content

[Feature Request] Add config option to disable copy-on-select behavior #10490

@cbrunnkvist

Description

@cbrunnkvist

OC implements "XTerm / GPM"-style copy-on-select

Selecting text with the mouse automatically copies it to the clipboard when the mouse button is released. As far as I can find, there is no way to disable this behavior.

I'd like to be able to turn off copy-on-select via opencode.json config because frankly it interferes with the way I read and mark text on screen, in particular when screen sharing or pair coding. And I really don't appreciate accidental clipboard overwrites when scrolling/selecting to read text.

I understand that the TUI is mouse-aware, and I am aware that in e.g. Ghostty's config I can set mouse-shift-capture = never to make shift+click always selects text, without notifying the app, but I'd still like to prevent OC from bungling my current clipboard contents.

Proposed Solution

I guess a tui.copy_on_select config option would suffice. Keep its default as true to avoid surprising existing users.

{
  "tui": {
    "copy_on_select": false
  }
}

Current Behavior

Mouse selection → automatic clipboard copy

Expected Behavior (when disabled)

Allows users to select text visually without side effects

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions