You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Reacted by Joscha Götzer, Westley Paynter, b3nw, Luis Eduardo, Gardner Bickford, Francesc Rosas, Seulgi Kim, Davide Bizzarri, Aphilas, Simone Daniotti and 3 more
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.
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! 👍
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.
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.
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
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.
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
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.
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.
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.
Activity
github-actions commentedon Dec 13, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
Raviguntakala commentedon Dec 14, 2025
You can disable this by setting the env value
OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true
magic-thomas commentedon Dec 15, 2025
I put this in .profile
export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELEC=trueand runsource .profile. And opencode opened again but it failed to disable automatic copy.Iterm2 - Ubuntu 24.04 remote server..
Raviguntakala commentedon Dec 16, 2025
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 commentedon 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:
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.rekram1-node commentedon Dec 16, 2025
yup we will fix that
Raviguntakala commentedon Dec 16, 2025
Cool 👍 I’m happy to work on this if you can share your preferred approach
rekram1-node commentedon Dec 16, 2025
@kommander do you have a preference on this or is that something you want to take care of?
kommander commentedon 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.
Raviguntakala commentedon Dec 16, 2025
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
rekram1-node commentedon Dec 16, 2025
and is this behavior only present if someone sets the flag?
Raviguntakala commentedon 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.
rekram1-node commentedon Dec 16, 2025
Sounds good to me so far then
Raviguntakala commentedon 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
kommander commentedon Dec 17, 2025
Yes
ctrl+con windows, in conpty at least afaik, sends aCTRL_C_EVENTwhich seems not handled correctly by bun and is not translated to SIGINT, so that signal cannot actually be handled. Will be fixed upstream.magic-thomas commentedon Dec 19, 2025
Sorry being late comments.
I fixed it with setting
OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=truebut 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.
coreyward commentedon 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.
github-actions commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.