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:
@@ -129,6 +129,38 @@ fn messages_with_value_parses() {
|
||||
crate::snap!("messages_verbose", a);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn copy_with_no_value_parses() {
|
||||
// Copy scope is optional — bare `copy` copies the whole panel.
|
||||
let a = assess_at_end("copy", &schema_empty());
|
||||
assert!(matches!(a.state, InputState::Valid));
|
||||
assert_eq!(a.parse_result.as_deref(), Ok("App(Copy)"));
|
||||
crate::snap!("copy_no_value", a);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn copy_all_parses() {
|
||||
let a = assess_at_end("copy all", &schema_empty());
|
||||
assert!(matches!(a.state, InputState::Valid));
|
||||
assert_eq!(a.parse_result.as_deref(), Ok("App(Copy)"));
|
||||
crate::snap!("copy_all", a);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn copy_last_parses() {
|
||||
let a = assess_at_end("copy last", &schema_empty());
|
||||
assert!(matches!(a.state, InputState::Valid));
|
||||
assert_eq!(a.parse_result.as_deref(), Ok("App(Copy)"));
|
||||
crate::snap!("copy_last", a);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn copy_space_offers_all_and_last() {
|
||||
let a = assess_at_end("copy ", &schema_empty());
|
||||
assert_candidate_present(&a, &["all", "last"]);
|
||||
crate::snap!("copy_space", a);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn partial_entry_word_classifies_as_definite_error_but_completes() {
|
||||
// `qu` — mid-typing the `quit` entry word.
|
||||
|
||||
Reference in New Issue
Block a user