From a91597d03b9d679c652be5b5402bfb8aefbd9fef Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 12 Nov 2025 12:00:30 -0700 Subject: Add new OSC 117 that allows executing an extension script. --- Cargo.toml | 6 +++--- src/ansi.rs | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1039801..5572fa8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Joe Wilm ", "Christian Duerr "] -description = "vte fork for the Alacritty's graphics patch" -repository = "https://github.com/ayosec/vte-graphics" +description = "vte fork for the Alacritty's graphics patch with Rahm's patches." +repository = "git@git.josher.dev:r-alacritty-vte.git" documentation = "https://docs.rs/vte-graphics/" keywords = ["ansi", "vte", "parser", "terminal"] categories = ["parsing", "no-std"] @@ -15,7 +15,7 @@ rust-version = "1.62.1" [features] ansi = ["log", "cursor-icon", "bitflags"] -default = ["std"] +default = ["std", "ansi"] std = ["memchr/std"] serde = ["dep:serde"] diff --git a/src/ansi.rs b/src/ansi.rs index 9dfc54f..ab0ca55 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -760,6 +760,8 @@ pub trait Handler { } debug!("[osc_unhandled]: [{}]", &buf); } + /// Extension to call a specific script with parameters. + fn extension_script(&mut self, _params: &Vec) {} // Set SCP control. fn set_scp(&mut self, _char_path: ScpCharPath, _update_mode: ScpUpdateMode) {} @@ -1545,6 +1547,14 @@ where // Reset text cursor color. b"112" => self.handler.reset_color(NamedColor::Cursor as usize), + b"117" => { + let strvec: Vec = params + .iter() + .map(|&bytes| String::from_utf8_lossy(bytes).to_string()) + .collect(); + self.handler.extension_script(&strvec) + }, + _ => unhandled!(), } } -- cgit