[FEATURE]: remove Copy with dragging. #3528

Open
opened 2026-02-16 17:40:31 -05:00 by yindo · 17 comments
Owner

Originally created by @magic-thomas on GitHub (Dec 13, 2025).

Originally assigned to: @kommander on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

#2773 was posted 3 months ago.. but it is not being treated .

We don't need automatic Copying with text dragging.. Manual Select / Copy is enough.

I request this stupid function to be removed from opencode.

Everyone might really need to copy text in SSH session.

I wish this dumb Copying function be removed ASAP.

Originally created by @magic-thomas on GitHub (Dec 13, 2025). Originally assigned to: @kommander on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request #2773 was posted 3 months ago.. but it is not being treated . We don't need automatic Copying with text dragging.. Manual Select / Copy is enough. I request this stupid function to be removed from opencode. Everyone might really need to copy text in SSH session. I wish this dumb Copying function be removed ASAP.
yindo added the discussion label 2026-02-16 17:40:31 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 13, 2025):

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

  • #2773: clipboard copy not works in remote SSH console (original issue from 3 months ago that you referenced)
  • #4283: Copy To Clipboard is not working
  • #5046: Can't copy text from opencode through mouse selection in Windows Terminal
  • #2755: feat: Copy Mode for OpenCode
  • #2125: Scrolling with weird text auto copies it to cursor input (related to auto-copy behavior)

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

@github-actions[bot] commented on GitHub (Dec 13, 2025): This issue might be a duplicate of existing issues. Please check: - #2773: clipboard copy not works in remote SSH console (original issue from 3 months ago that you referenced) - #4283: Copy To Clipboard is not working - #5046: Can't copy text from opencode through mouse selection in Windows Terminal - #2755: feat: Copy Mode for OpenCode - #2125: Scrolling with weird text auto copies it to cursor input (related to auto-copy behavior) Feel free to ignore if none of these address your specific case.
Author
Owner

@Raviguntakala commented on GitHub (Dec 14, 2025):

You can disable this by setting the env value
OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true

@Raviguntakala commented on GitHub (Dec 14, 2025): You can disable this by setting the env value OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true
Author
Owner

@magic-thomas commented on GitHub (Dec 15, 2025):

You can disable this by setting the env value OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true

I put this in .profile export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELEC=true and run source .profile . And opencode opened again but it failed to disable automatic copy.

Iterm2 - Ubuntu 24.04 remote server..

@magic-thomas commented on GitHub (Dec 15, 2025): > You can disable this by setting the env value OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true I put this in .profile `export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELEC=true` and run `source .profile` . And opencode opened again but it failed to disable automatic copy. Iterm2 - Ubuntu 24.04 remote server..
Author
Owner

@Raviguntakala commented on GitHub (Dec 15, 2025):

You can disable this by setting the env value OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true

I put this in .profile export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELEC=true and run source .profile . And opencode opened again but it failed to disable automatic copy.

Iterm2 - Ubuntu 24.04 remote server..

The environment variable has a typo - it's missing the "T" at the end. Should be OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT (not SELEC). Fixed it and it works now! 👍

@Raviguntakala commented on GitHub (Dec 15, 2025): > > You can disable this by setting the env value OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true > > I put this in .profile `export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELEC=true` and run `source .profile` . And opencode opened again but it failed to disable automatic copy. > > Iterm2 - Ubuntu 24.04 remote server.. The environment variable has a typo - it's missing the "T" at the end. Should be OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT (not SELEC). Fixed it and it works now! 👍
Author
Owner

@Raviguntakala commented on GitHub (Dec 16, 2025):

@rekram1-node I disabled copy on select flag When selecting text, the selection gets cleared, so nothing can be copied.
This seems to come from:

if (Flag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT) {
  renderer.clearSelection()
  return
}

Even if renderer.clearSelection() is removed, how are we supposed to copy selected content? Ctrl+C is still used for exit, so there doesn’t seem to be a manual copy path.

@Raviguntakala commented on GitHub (Dec 16, 2025): @rekram1-node I disabled **copy on select flag** When selecting text, the selection gets cleared, so nothing can be copied. This seems to come from: ```ts if (Flag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT) { renderer.clearSelection() return } ``` Even if `renderer.clearSelection()` is removed, how are we supposed to copy selected content? **Ctrl+C** is still used for exit, so there doesn’t seem to be a manual copy path.
Author
Owner

@rekram1-node commented on GitHub (Dec 16, 2025):

yup we will fix that

@rekram1-node commented on GitHub (Dec 16, 2025): yup we will fix that
Author
Owner

@Raviguntakala commented on GitHub (Dec 16, 2025):

Cool 👍 I’m happy to work on this if you can share your preferred approach

@Raviguntakala commented on GitHub (Dec 16, 2025): Cool 👍 I’m happy to work on this if you can share your preferred approach
Author
Owner

@rekram1-node commented on GitHub (Dec 16, 2025):

@kommander do you have a preference on this or is that something you want to take care of?

@rekram1-node commented on GitHub (Dec 16, 2025): @kommander do you have a preference on this or is that something you want to take care of?
Author
Owner

@kommander commented on GitHub (Dec 16, 2025):

Not really. I'd just change it to get the selected text on a keybinding trigger and use the available "copy to clipboard" method and implementation. Biggest issue will be keybinding again, as many are overloaded and people will have contradicting expectations for the defaults again.

@kommander commented on GitHub (Dec 16, 2025): Not really. I'd just change it to get the selected text on a keybinding trigger and use the available "copy to clipboard" method and implementation. Biggest issue will be keybinding again, as many are overloaded and people will have contradicting expectations for the defaults again.
Author
Owner

@Raviguntakala commented on GitHub (Dec 16, 2025):

Not really. I'd just change it to get the selected text on a keybinding trigger and use the available "copy to clipboard" method and implementation. Biggest issue will be keybinding again, as many are overloaded and people will have contradicting expectations for the defaults again.

I actually started working on this locally and tried a similar approach by removing clearSelection() when the flag is enabled. I also handled Ctrl+C similar to #4900 if there’s selected content, Ctrl+C copies it; otherwise it shows the “Press again to exit” toast, which helps avoid accidental exits. But I don’t think this is the most optimal solution, so I wanted to check your preference before continuing

@Raviguntakala commented on GitHub (Dec 16, 2025): > Not really. I'd just change it to get the selected text on a keybinding trigger and use the available "copy to clipboard" method and implementation. Biggest issue will be keybinding again, as many are overloaded and people will have contradicting expectations for the defaults again. I actually started working on this locally and tried a similar approach by removing clearSelection() when the flag is enabled. I also handled Ctrl+C similar to #4900 if there’s selected content, Ctrl+C copies it; otherwise it shows the “Press again to exit” toast, which helps avoid accidental exits. But I don’t think this is the most optimal solution, so I wanted to check your preference before continuing
Author
Owner

@rekram1-node commented on GitHub (Dec 16, 2025):

and is this behavior only present if someone sets the flag?

@rekram1-node commented on GitHub (Dec 16, 2025): and is this behavior only present if someone sets the flag?
Author
Owner

@Raviguntakala commented on GitHub (Dec 16, 2025):

Yes, this only happens when the flag is enabled. If the flag is not set, selecting text works normally. Once the user releases the mouse, the text is copied as usual, and exiting requires pressing Ctrl+C twice.

@Raviguntakala commented on GitHub (Dec 16, 2025): Yes, this only happens when the flag is enabled. If the flag is not set, selecting text works normally. Once the user releases the mouse, the text is copied as usual, and exiting requires pressing Ctrl+C twice.
Author
Owner

@rekram1-node commented on GitHub (Dec 16, 2025):

Sounds good to me so far then

@rekram1-node commented on GitHub (Dec 16, 2025): Sounds good to me so far then
Author
Owner

@Raviguntakala commented on GitHub (Dec 17, 2025):

One note though: this works on macOS and Linux, but on Windows the first Ctrl C exits immediately. Looks like SIGINT kills the process before our handler runs. Might be related to #5071

@Raviguntakala commented on GitHub (Dec 17, 2025): One note though: this works on macOS and Linux, but on Windows the first Ctrl C exits immediately. Looks like SIGINT kills the process before our handler runs. Might be related to #5071
Author
Owner

@kommander commented on GitHub (Dec 17, 2025):

Yes ctrl+c on windows, in conpty at least afaik, sends a CTRL_C_EVENT which seems not handled correctly by bun and is not translated to SIGINT, so that signal cannot actually be handled. Will be fixed upstream.

@kommander commented on GitHub (Dec 17, 2025): Yes `ctrl+c` on windows, in conpty at least afaik, sends a `CTRL_C_EVENT` which seems not handled correctly by bun and is not translated to SIGINT, so that signal cannot actually be handled. Will be fixed upstream.
Author
Owner

@magic-thomas commented on GitHub (Dec 19, 2025):

You can disable this by setting the env value OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true

I put this in .profile export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELEC=true and run source .profile . And opencode opened again but it failed to disable automatic copy.
Iterm2 - Ubuntu 24.04 remote server..

The environment variable has a typo - it's missing the "T" at the end. Should be OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT (not SELEC). Fixed it and it works now! 👍

Sorry being late comments.

I fixed it with setting OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true but got another issue.

It does not show 'copied to clipboard' message but could not keep selected text after dragging.

So I can not copy on SSH terminal again .

Does anyone have same experience or idea to fix it?

My Env.
M1 Mac pro iterms2 SSH to Ubuntu 24.04 LTS server.

@magic-thomas commented on GitHub (Dec 19, 2025): > > > You can disable this by setting the env value OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true > > > > > > I put this in .profile `export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELEC=true` and run `source .profile` . And opencode opened again but it failed to disable automatic copy. > > Iterm2 - Ubuntu 24.04 remote server.. > > The environment variable has a typo - it's missing the "T" at the end. Should be OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT (not SELEC). Fixed it and it works now! 👍 Sorry being late comments. I fixed it with setting `OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true` but got another issue. It does not show 'copied to clipboard' message but could not keep selected text after dragging. So I can not copy on SSH terminal again . Does anyone have same experience or idea to fix it? My Env. M1 Mac pro iterms2 SSH to Ubuntu 24.04 LTS server.
Author
Owner

@coreyward commented on GitHub (Jan 3, 2026):

Not sure what the status is here but it seems like this flag is only in one place (in app.tsx) when the copy-on-select behavior appears to happen elsewhere as well (e.g., dialog.tsx). My issue with it is primarily that when I highlight text in OpenCode, I wind up with it triggering a copy twice in a row. This then triggers Alfred’s clipboard append action, so I don't get the highlighted text in my clipboard directly, and I've mangled whatever I already had in my clipboard as well.

@coreyward commented on GitHub (Jan 3, 2026): Not sure what the status is here but it seems like this flag is only in one place (in app.tsx) when the copy-on-select behavior appears to happen elsewhere as well (e.g., dialog.tsx). My issue with it is primarily that when I highlight text in OpenCode, I wind up with it triggering a copy twice in a row. This then triggers Alfred’s clipboard append action, so I don't get the highlighted text in my clipboard directly, and I've mangled whatever I already had in my clipboard as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3528