Skip to content

[FEATURE]: remove Copy with dragging. #5489

Closed as not planned
Closed as not planned

Description

@magic-thomas

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.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Dec 13, 2025
  2. github-actions commented on Dec 13, 2025

    @github-actions
    Contributor

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

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

  3. Raviguntakala commented on Dec 14, 2025

    @Raviguntakala
    Contributor

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

  4. magic-thomas commented on Dec 15, 2025

    @magic-thomas
    Author

    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..

  5. Raviguntakala commented on Dec 16, 2025

    @Raviguntakala
    Contributor

    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! 👍

  6. Raviguntakala commented on Dec 16, 2025

    @Raviguntakala
    Contributor

    @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.

  7. rekram1-node commented on Dec 16, 2025

    @rekram1-node
    Collaborator

    yup we will fix that

  8. Raviguntakala commented on Dec 16, 2025

    @Raviguntakala
    Contributor

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

  9. rekram1-node commented on Dec 16, 2025

    @rekram1-node
    Collaborator

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

  10. kommander commented on Dec 16, 2025

    @kommander
    Contributor

    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.

  11. Raviguntakala commented on Dec 16, 2025

    @Raviguntakala
    Contributor

    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

  12. rekram1-node commented on Dec 16, 2025

    @rekram1-node
    Collaborator

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

  13. Raviguntakala commented on Dec 16, 2025

    @Raviguntakala
    Contributor

    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.

  14. rekram1-node commented on Dec 16, 2025

    @rekram1-node
    Collaborator

    Sounds good to me so far then

  15. Raviguntakala commented on Dec 17, 2025

    @Raviguntakala
    Contributor

    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

  16. kommander commented on Dec 17, 2025

    @kommander
    Contributor

    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.

  17. magic-thomas commented on Dec 19, 2025

    @magic-thomas
    Author

    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.

  18. coreyward commented on Jan 3, 2026

    @coreyward

    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.

  19. github-actions commented on Mar 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  20. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on May 3, 2026
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