feat: copy the output panel to the system clipboard (#11)

New app-level `copy` / `copy all` / `copy last` command (ADR-0041).
Delivery is OSC 52 *and* a best-effort native write (arboard), always
both — OSC 52 acceptance is undetectable, so a true fallback can't be
built. Payload is the panel's plain text exactly as rendered (tags,
✓/✗, box-drawing), drift-locked to render_output_line. arboard added
--no-default-features (X11-only; OSC 52 covers Wayland).

Amends ADR-0003's command registry; requirements V6.
This commit is contained in:
claude@clouddev1
2026-06-02 14:23:21 +00:00
parent 1ea376be26
commit d0c8f9d5d2
25 changed files with 1203 additions and 13 deletions
+14
View File
@@ -516,6 +516,19 @@ pub enum AppCommand {
Undo,
/// Re-apply the most recently undone change, after confirmation.
Redo,
/// Copy the output panel to the system clipboard (ADR-0041).
/// `copy` / `copy all` copy the whole panel; `copy last` copies
/// the most recent command's output.
Copy { scope: CopyScope },
}
/// Which slice of the output panel `copy` targets (ADR-0041).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CopyScope {
/// The entire output buffer (`copy` bare, or `copy all`).
All,
/// From the most recent echo line to the end (`copy last`).
Last,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -871,6 +884,7 @@ impl Command {
AppCommand::Messages { .. } => "messages",
AppCommand::Undo => "undo",
AppCommand::Redo => "redo",
AppCommand::Copy { .. } => "copy",
},
}
}