Skip to content

[FEATURE]: Add copy to clipboard functionality for outputted snippets of code #5641

Closed as not planned

Description

@sohcfst

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

Sometimes I have opencode (tui) generate sql for me to run in my local db gui, or code for me to just play with but the output can be pretty long. I have to zoom out a bunch to copy the snippet sometimes.

Maybe a dumb workflow! But I do it.

Also just posting here to put out a feeler, and maybe make my first contribution to open source that if there's any interest.

Love OC!

Cheers

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Dec 16, 2025
  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 16, 2025
  3. github-actions commented on Dec 16, 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.

  4. rekram1-node commented on Dec 16, 2025

    @rekram1-node
    Contributor

    Someone had an idea where you could click a tool call and view it w/ more detail

    Are you looking to copy code in markdown or like the actual code from an edit / write?

  5. ariane-emory commented on Dec 16, 2025

    @ariane-emory
    Contributor

    @sohcfst This isn't exactly what you're looking for, but might be an acceptable second choice in the meantime: you can copy entire messages by clicking on them and selecting the Copy option in the modal that appears (which will not exactly align with your desired feature because any non-code content in the message will also be copied, you would have to edit that out yourself).

  6. sohcfst commented on Dec 17, 2025

    @sohcfst
    Author

    @ariane-emory hmm I tried, and I can right click and copy my own message, but not the code output. is right clicking + copy possible with responses?

    @rekram1-node hmm personally I'm not interested in diving into tool calls but that sounds neat!

    not from an edit or write, just generating snippets on the fly. i attached a pic of an example of something i might generate. sometimes i'll have to zoom out 500% to select and copy the text if it's way longer than the viewport

    Image
  7. ariane-emory commented on Dec 17, 2025

    @ariane-emory
    Contributor

    @sohcfst Geeze, you're correct. I must have spaced out and confused myself, my answer was absolutely wrong, sorry!

    Now that I've un-confused myself, I do think that having similar copy-on-click functionality to user messages on the agent/tool messages does sound like it could be useful.

  8. sohcfst commented on Dec 19, 2025

    @sohcfst
    Author

    @ariane-emory no worries! what happened with your PR? saw you attempted?

  9. ariane-emory commented on Dec 19, 2025

    @ariane-emory
    Contributor

    @sohcfst Sorry, I'd gotten distracted by looking at other things.... also, I realizes that messages_copy already covered most cases (it does only copy the last agent message, but most of the time that's the one that the user would want to copy).

  10. ariane-emory commented on Dec 19, 2025

    @ariane-emory
    Contributor

    @sohcfst Oh, that was just a dummy PR on my personal fork (not on sst/opencode) of a WIP that didn't successfully resolve the issue.

  11. J-F-M commented on Feb 27, 2026

    @J-F-M

    The ability to copy the (markdown-formatted) LLM output from the TUI would be a great improvement for my workflow.

    I also use Opencode to generate Markdown content which I want to save/paste for further manual editing and reuse as context.

  12. github-actions commented on Apr 29, 2026

    @github-actions
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussionopentuiThis 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