diff options
| author | Josh Rahm <rahm@google.com> | 2025-11-12 12:00:30 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2025-11-12 12:00:30 -0700 |
| commit | a91597d03b9d679c652be5b5402bfb8aefbd9fef (patch) | |
| tree | 42303393d0e5520d624641c9c8e95cba26b210d8 | |
| parent | 22c7c29c0303398baa71db8798473ee704f9717c (diff) | |
| download | r-alacritty-vte-rahm-graphics.tar.gz r-alacritty-vte-rahm-graphics.tar.bz2 r-alacritty-vte-rahm-graphics.zip | |
Add new OSC 117 that allows executing an extension script.rahm-graphics
| -rw-r--r-- | Cargo.toml | 6 | ||||
| -rw-r--r-- | src/ansi.rs | 10 |
2 files changed, 13 insertions, 3 deletions
@@ -1,7 +1,7 @@ [package] authors = ["Joe Wilm <joe@jwilm.com>", "Christian Duerr <contact@christianduerr.com>"] -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<String>) {} // 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<String> = params + .iter() + .map(|&bytes| String::from_utf8_lossy(bytes).to_string()) + .collect(); + self.handler.extension_script(&strvec) + }, + _ => unhandled!(), } } |