[FEATURE]: Copy assistant messages as rich text for pasting into Google Docs, Notion, etc. #7645

Open
opened 2026-02-16 18:07:49 -05:00 by yindo · 1 comment
Owner

Originally created by @rscarvalho on GitHub (Jan 26, 2026).

Originally assigned to: @thdxr on GitHub.

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

Problem

OpenCode renders markdown beautifully in the terminal - headers, code blocks, lists, and formatting all look great. But when I copy Claude's responses to paste into Google Docs, Notion, or other rich text editors, all that formatting is lost. I get plain text and have to manually reformat everything.

Proposed Solution

Add a setting copy_as_rich_text (default: false) that converts markdown to HTML when copying assistant messages. When enabled:

  • Bold, italic, inline code, and links preserve their formatting
  • Headers, bullet lists, and numbered lists maintain structure
  • Code blocks become monospace <pre> blocks
  • Tables stay as tables

The feature would gracefully fall back to plain text with a helpful warning toast if the system doesn't support rich text clipboard (e.g., missing wl-clipboard on Linux, or copying over SSH).

Use Cases

  1. Documentation: Copy Claude's explanations directly into team docs without reformatting
  2. Note-taking: Paste code snippets and instructions into Notion/Obsidian with formatting intact
  3. Sharing: Quickly share formatted responses in emails or collaborative documents

Usage

Option 1: Toggle at runtime

Press Ctrl+P to open the command palette and select "Toggle copy as rich text". A toast confirms the current mode. This setting persists for the session.

Option 2: Set in config (permanent default)

{
  "tui": {
    "copy_as_rich_text": true,
  },
}

Platform Considerations

  • macOS: AppleScript pasteboard (built-in)
  • Linux Wayland: wl-copy --type text/html (requires wl-clipboard)
  • Linux X11: xclip -t text/html (requires xclip)
  • Windows: PowerShell clipboard API (built-in)
  • SSH/tmux: Falls back to plain text with notification
Originally created by @rscarvalho on GitHub (Jan 26, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request ## Problem OpenCode renders markdown beautifully in the terminal - headers, code blocks, lists, and formatting all look great. But when I copy Claude's responses to paste into Google Docs, Notion, or other rich text editors, all that formatting is lost. I get plain text and have to manually reformat everything. ## Proposed Solution Add a setting `copy_as_rich_text` (default: `false`) that converts markdown to HTML when copying assistant messages. When enabled: - **Bold**, _italic_, `inline code`, and links preserve their formatting - Headers, bullet lists, and numbered lists maintain structure - Code blocks become monospace `<pre>` blocks - Tables stay as tables The feature would gracefully fall back to plain text with a helpful warning toast if the system doesn't support rich text clipboard (e.g., missing `wl-clipboard` on Linux, or copying over SSH). ## Use Cases 1. **Documentation**: Copy Claude's explanations directly into team docs without reformatting 2. **Note-taking**: Paste code snippets and instructions into Notion/Obsidian with formatting intact 3. **Sharing**: Quickly share formatted responses in emails or collaborative documents ## Usage **Option 1: Toggle at runtime** Press `Ctrl+P` to open the command palette and select "Toggle copy as rich text". A toast confirms the current mode. This setting persists for the session. **Option 2: Set in config (permanent default)** ```jsonc { "tui": { "copy_as_rich_text": true, }, } ``` ## Platform Considerations - **macOS**: AppleScript pasteboard (built-in) - **Linux Wayland**: `wl-copy --type text/html` (requires wl-clipboard) - **Linux X11**: `xclip -t text/html` (requires xclip) - **Windows**: PowerShell clipboard API (built-in) - **SSH/tmux**: Falls back to plain text with notification
yindo added the discussion label 2026-02-16 18:07:49 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 26, 2026):

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

  • #10641: Feature request for copy button positioning
  • #10098: Feature request for maintaining newline when copying output
  • #10545: TUI copy shortcut feature request

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

@github-actions[bot] commented on GitHub (Jan 26, 2026): This issue might be a duplicate of existing issues. Please check: - #10641: Feature request for copy button positioning - #10098: Feature request for maintaining newline when copying output - #10545: TUI copy shortcut feature request Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7645