diff --git a/CHANGELOG.md b/CHANGELOG.md index 53fb074..e22bb82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - add `window.opacity` for a transparent background (compositor-dependent) ### Fixed +- accept OSC 52 clipboard payloads larger than 1 KiB; copying long text over SSH no longer fails silently - honour SGR colon subparameters: `4:0` now turns underline off (was leaving the whole screen underlined) and `38:2:r:g:b` / `48:5:n` colours are applied ## [0.10.0] - 2026-07-25 diff --git a/Cargo.lock b/Cargo.lock index 5654f1b..6386a07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2604,7 +2604,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a0b683b20ef64071ff03745b14391751f6beab06a54347885459b77a3f2caa5" dependencies = [ - "arrayvec", "utf8parse", "vte_generate_state_changes", ] diff --git a/Cargo.toml b/Cargo.toml index f7ba1d5..0ee154b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,9 @@ softbuffer = "0.4" fontdue = "0.9" # ANSI/VT escape code parser -vte = "0.13" +# default-features = false swaps vte's fixed 1 KiB ArrayVec OSC buffer for a +# growable Vec, so large OSC 52 clipboard payloads are not truncated. +vte = { version = "0.13", default-features = false } # PTY backend (Linux/macOS: forkpty/posix_openpt) portable-pty = "0.9" diff --git a/src/terminal/parser_test.rs b/src/terminal/parser_test.rs index 6487963..867fd26 100644 --- a/src/terminal/parser_test.rs +++ b/src/terminal/parser_test.rs @@ -1045,6 +1045,22 @@ fn osc52_write_with_st_terminator() { assert_eq!(p.grid.pending_clipboard_write.as_deref(), Some("hello")); } +#[test] +fn osc52_write_handles_payload_larger_than_1kb() { + let mut p = make_parser(80, 24); + // ~1 KB of text -> ~1.3 KB of base64, past vte's 1024-byte OSC buffer + let text = "x".repeat(981); + let encoded = BASE64.encode(text.as_bytes()); + let mut seq = b"\x1b]52;c;".to_vec(); + seq.extend_from_slice(encoded.as_bytes()); + seq.extend_from_slice(b"\x07"); + p.process(&seq); + assert_eq!( + p.grid.pending_clipboard_write.as_deref(), + Some(text.as_str()) + ); +} + #[test] fn dec_line_drawing_box_chars() { let mut p = make_parser(80, 24);