Copy output panel contents to the system clipboard #11

Closed
opened 2026-05-28 14:44:56 +01:00 by oliversturm · 1 comment
oliversturm commented 2026-05-28 14:44:56 +01:00 (Migrated from github.com)

Motivation

Bug reports today require the user to terminal-select the relevant region of the output panel, fiddle with wrapping/border characters, and paste. A built-in "copy to clipboard" would eliminate ~80% of that friction and dramatically improve the bug-report → reproduction loop.

Scope to decide

  • Copy all current panel contents, or copy a selection (range)?
  • Copy the most recent command's full output (echo + body + summary) as one unit?
  • Plain text vs styled (ANSI / markdown)? Markdown is most portable for issues.
  • A keybinding (e.g. Ctrl-Y, or y over a navigated region) vs an app command (copy, copy last)?

Implementation

Cross-platform Rust crates worth evaluating:

  • arboard — actively maintained, X11/Wayland/macOS/Windows.
  • copypasta — older but still in use.
  • OSC 52 escape-sequence emission — terminal-side clipboard, works over SSH, no native dep; needs terminal emulator support.

OSC 52 plus a native-clipboard fallback is probably the right combination.

### Motivation Bug reports today require the user to terminal-select the relevant region of the output panel, fiddle with wrapping/border characters, and paste. A built-in "copy to clipboard" would eliminate ~80% of that friction and dramatically improve the bug-report → reproduction loop. ### Scope to decide - Copy *all* current panel contents, or copy a selection (range)? - Copy the most recent command's full output (echo + body + summary) as one unit? - Plain text vs styled (ANSI / markdown)? Markdown is most portable for issues. - A keybinding (e.g. Ctrl-Y, or `y` over a navigated region) vs an app command (`copy`, `copy last`)? ### Implementation Cross-platform Rust crates worth evaluating: - [`arboard`](https://crates.io/crates/arboard) — actively maintained, X11/Wayland/macOS/Windows. - [`copypasta`](https://crates.io/crates/copypasta) — older but still in use. - OSC 52 escape-sequence emission — terminal-side clipboard, works over SSH, no native dep; needs terminal emulator support. OSC 52 plus a native-clipboard fallback is probably the right combination.
oliversturm commented 2026-06-02 15:30:33 +01:00 (Migrated from github.com)

Resolved by ADR-0041 (commit d0c8f9d). New app-level copy / copy all / copy last command: OSC 52 escape + best-effort native (arboard) write, always both; payload is the output panel's plain text exactly as rendered. Full-stack PTY-verified. See docs/handoff/20260602-handoff-55.md.

Resolved by ADR-0041 (commit d0c8f9d). New app-level `copy` / `copy all` / `copy last` command: OSC 52 escape + best-effort native (arboard) write, always both; payload is the output panel's plain text exactly as rendered. Full-stack PTY-verified. See docs/handoff/20260602-handoff-55.md.
Sign in to join this conversation.