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
There currently seems no way to copy the LLM's markdown response as markdown. Highlighting the message and selecting strips all the markdown formatting, making it somewhat useless.
Conveniently there's a UI for clicking and copying the message text of the original prompt:
But this seems to only work for the first message, not subsequent ones.
Something like this, or a shortcut like the c key in crush would be nice to be able to copy the entire message contents (of a clicked message) in its raw format.
Reacted by Kwami Agbodji, Haaris Rahman and Oskar Jagodziński
This doesn't appear to work in OpenCode TUI in VSCode (with VSCode extension installed). ctrl-p just opens VSCode command pallet. /copy says it copies history, but nothing ends up on clipboard.
I'd like to take a crack at this if there's interest. I filed #18967 (now closed as duplicate) with a concrete implementation approach:
Replace the single copy IconButton in message-part.tsx with a DropdownMenu (already exists in packages/ui). Three options: Copy Text (current behavior), Copy Markdown (raw markdown as text/plain), Copy for Email (sanitized HTML via navigator.clipboard.write() with text/html MIME type so Gmail/Outlook render it correctly).
The email HTML sanitization strips all classes/styles and inlines email-safe CSS on key elements (monospace code blocks, bordered tables, styled blockquotes, blue links, Arial 14px base font). I've built and tested this pattern in another project.
Scoped entirely to packages/ui/src/components/message-part.tsx. No API changes. Happy to submit a PR if a maintainer can confirm this approach is acceptable.
I want to add a concrete TUI use case here, which is closely related to #10693 but has a slightly different priority.
When I copy assistant output by selecting text directly in the terminal/TUI (for example with the mouse), what gets copied is the rendered plain text, not the underlying markdown source.
That causes serious problems when pasting into markdown/block-based editors such as SiYuan:
inline code loses its backticks
headings lose markdown markers
nested lists often collapse because the pasted text only preserves visual indentation, not reliable markdown structure
blank-line semantics between paragraphs/lists are lost or become inconsistent
syntax-highlighted / emphasized content is reduced to plain text
So from the user's perspective, the TUI is showing a nicely rendered "poster", but the clipboard only receives flattened text, not the "blueprint" needed by markdown-aware editors.
For tools like Google Docs / Notion, rich text copy is useful (#10693).
But for markdown-native editors, Copy as Markdown is even more important than rich text.
What would help most:
Allow copying any assistant message as raw markdown, not just visually selecting rendered text
Keep this available for arbitrary assistant messages, not only the first/last message
Optionally also support rich text copy as a separate mode for Docs/Notion/email-style targets
Suggested copy modes would be:
Plain text
Markdown
Rich text
In short: this issue is not only about convenience; it is about preserving the semantic structure of assistant output when leaving the TUI.
Activity
github-actions commentedon Feb 17, 2026
This issue might be a duplicate of an existing feature request. Please check:
nicopujia commentedon Mar 4, 2026
ctrl+p → copy last assistant message
or
ctrl+x y
taoeffect commentedon Mar 5, 2026
Thanks @nicopujia, that's super helpful!
I'll still leave the issue open though because I feel like you should be able to do this for all messages, not just the first and the last.
MicahZoltu commentedon Mar 14, 2026
This doesn't appear to work in OpenCode TUI in VSCode (with VSCode extension installed). ctrl-p just opens VSCode command pallet.
/copysays it copies history, but nothing ends up on clipboard.wuxiaoqiang12 commentedon Mar 18, 2026
I also want this feature like Alt + m in gemini cli.
andrewdunndev commentedon Mar 24, 2026
I'd like to take a crack at this if there's interest. I filed #18967 (now closed as duplicate) with a concrete implementation approach:
Replace the single copy
IconButtoninmessage-part.tsxwith aDropdownMenu(already exists inpackages/ui). Three options: Copy Text (current behavior), Copy Markdown (raw markdown astext/plain), Copy for Email (sanitized HTML vianavigator.clipboard.write()withtext/htmlMIME type so Gmail/Outlook render it correctly).The email HTML sanitization strips all classes/styles and inlines email-safe CSS on key elements (monospace code blocks, bordered tables, styled blockquotes, blue links, Arial 14px base font). I've built and tested this pattern in another project.
Scoped entirely to
packages/ui/src/components/message-part.tsx. No API changes. Happy to submit a PR if a maintainer can confirm this approach is acceptable.RiAnBee commentedon Mar 26, 2026
I want to add a concrete TUI use case here, which is closely related to #10693 but has a slightly different priority.
When I copy assistant output by selecting text directly in the terminal/TUI (for example with the mouse), what gets copied is the rendered plain text, not the underlying markdown source.
That causes serious problems when pasting into markdown/block-based editors such as SiYuan:
So from the user's perspective, the TUI is showing a nicely rendered "poster", but the clipboard only receives flattened text, not the "blueprint" needed by markdown-aware editors.
For tools like Google Docs / Notion, rich text copy is useful (#10693).
But for markdown-native editors,
Copy as Markdownis even more important than rich text.What would help most:
Suggested copy modes would be:
In short: this issue is not only about convenience; it is about preserving the semantic structure of assistant output when leaving the TUI.
github-actions commentedon Jul 4, 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.
monarchwadia commentedon Jul 29, 2026
Wanted to bump this. Still an issue.
taoeffect commentedon Aug 10, 2026
Followup opened #41609