add OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT #4996
Merged
rekram1-node merged 1 commit intodevfrom Dec 2, 2025
Merged
Conversation
Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
1 task
github-actions bot
pushed a commit
that referenced
this pull request
Dec 2, 2025
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
spmurrayzzz
pushed a commit
to spmurrayzzz/opencode
that referenced
this pull request
Dec 5, 2025
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
coreyward
reviewed
Jan 3, 2026
| backgroundColor={theme.background} | ||
| onMouseUp={async () => { | ||
| if (Flag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT) { | ||
| renderer.clearSelection() |
There was a problem hiding this comment.
Is there a reason the user selection is being cleared here? It prevents the user from copying it themselves, if desired.
There was a problem hiding this comment.
Until they fix the code to not clear selection, you can shift+mouse drag, this way it wont clear the selected, you can than copy to clipboard ctrl+c normally. (works in GhosTTY)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Perfect! I've successfully implemented the feature. Here's a summary of the changes:
Changes Made
1. Added flag to
flag.ts(line 20):OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECTflag that reads from theOPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECTenvironment variable"true"or"1", it will disable the copy-on-select behavior2. Updated
app.tsx(lines 464-467):FlagnamespaceonMouseUphandler to check ifFlag.OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECTis enabledHow to Use
Users can now disable copy-on-select by setting the environment variable:
export OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT=true opencodeOr with value
"1":This will allow users to highlight text without automatically polluting their clipboard, addressing the issue raised in #2845.
Closes #4751
opencode session | github run