diff options
author | Josh Rahm <rahm@google.com> | 2024-06-25 18:01:36 -0600 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2024-08-14 15:42:42 -0600 |
commit | 001a0da746c695721490c7cf6f3153c6351603f3 (patch) | |
tree | 8b6f9a3f27437de460292d6901671a7f93cae9b8 /alacritty_terminal/src | |
parent | 026c1af550bf65e9116344f931f3cfdc1e6193f5 (diff) | |
download | r-alacritty-rahm2.tar.gz r-alacritty-rahm2.tar.bz2 r-alacritty-rahm2.zip |
Add alacritty extension script support.rahm2
This allows an escape code to invoke user-defined extensions found in
/home/rahm/.local/bin/alacritty-ext.sh. The terminal passes to this
script the escape-code arguments.
This allows things like opening links in the browser even through an ssh
connection.
Diffstat (limited to 'alacritty_terminal/src')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 4113ed9c..b0c1dab7 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1,6 +1,7 @@ //! Exports the `Term` type which is a high-level API for the Grid. use std::ops::{Index, IndexMut, Range}; +use std::process::Command; use std::sync::Arc; use std::{cmp, mem, ptr, slice, str}; @@ -1716,6 +1717,16 @@ impl<T: EventListener> Handler for Term<T> { } #[inline] + fn extension_script(&mut self, args: &Vec<String>) { + match Command::new("/home/rahm/.local/bin/alacritty-ext.sh").args(args).output() { + Ok(_) => {}, + Err(v) => { + println!("Failed to run alacritty command. {}", v); + }, + } + } + + #[inline] fn clear_screen(&mut self, mode: ansi::ClearMode) { trace!("Clearing screen: {:?}", mode); let bg = self.grid.cursor.template.bg; |