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
{{ message }}
Repository navigation
[FEATURE]: Add copy to clipboard functionality for outputted snippets of code #5641
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.
@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).
@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
@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.
@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).
Activity
github-actions commentedon Dec 16, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Dec 16, 2025
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?
ariane-emory commentedon Dec 16, 2025
@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).
sohcfst commentedon Dec 17, 2025
@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
ariane-emory commentedon Dec 17, 2025
@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.
Add copy-to-clipboard functionality for assistant message parts
sohcfst commentedon Dec 19, 2025
@ariane-emory no worries! what happened with your PR? saw you attempted?
ariane-emory commentedon Dec 19, 2025
@sohcfst Sorry, I'd gotten distracted by looking at other things.... also, I realizes that
messages_copyalready 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).ariane-emory commentedon Dec 19, 2025
@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.
J-F-M commentedon Feb 27, 2026
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.
github-actions commentedon Apr 29, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.