aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2025-02-06 12:27:56 -0700
committerJosh Rahm <rahm@google.com>2025-11-12 11:49:18 -0700
commit71adb2de6455630abd4e22cd5990a7137cafd8fd (patch)
tree842662257cc6bcfe7373d7df4edfb6a192cb04b0
parent1a18c5a963575bcacbdc8783c9214484f8dbe80a (diff)
downloadr-alacritty-rahm.tar.gz
r-alacritty-rahm.tar.bz2
r-alacritty-rahm.zip
Add alacritty extension script support.HEADrahm
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.
-rw-r--r--alacritty_terminal/src/term/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs
index 9fc4c4cd..a5cb7eb9 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};
@@ -1773,6 +1774,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;