Skip to content

[FEATURE]: Copy message as raw markdown #14041

Closed as not planned
Closed as not planned

Description

@taoeffect

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

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:

Image

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.

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Feb 17, 2026
  2. github-actions commented on Feb 17, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing feature request. Please check:

  3. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 17, 2026
  4. nicopujia commented on Mar 4, 2026

    @nicopujia

    ctrl+p → copy last assistant message

    or

    ctrl+x y

  5. taoeffect commented on Mar 5, 2026

    @taoeffect
    Author

    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.

  6. MicahZoltu commented on Mar 14, 2026

    @MicahZoltu

    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.

  7. wuxiaoqiang12 commented on Mar 18, 2026

    @wuxiaoqiang12

    I also want this feature like Alt + m in gemini cli.

  8. andrewdunndev commented on Mar 24, 2026

    @andrewdunndev

    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.

  9. RiAnBee commented on Mar 26, 2026

    @RiAnBee

    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:

    1. Allow copying any assistant message as raw markdown, not just visually selecting rendered text
    2. Keep this available for arbitrary assistant messages, not only the first/last message
    3. 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.

  10. removed
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  11. github-actions commented on Jul 4, 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.

  12. monarchwadia commented on Jul 29, 2026

    @monarchwadia

    Wanted to bump this. Still an issue.

  13. taoeffect commented on Aug 10, 2026

    @taoeffect
    Author

    Followup opened #41609

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