diff --git a/Cargo.lock b/Cargo.lock index 566dbc08d55..80a3f917d86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,7 +150,7 @@ dependencies = [ "anstyle-wincon", "colorchoice", "is_terminal_polyfill", - "utf8parse", + "utf8parse 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -165,7 +165,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ - "utf8parse", + "utf8parse 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2013,6 +2013,11 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "git+https://github.com/zed-industries/vte?branch=osc-133-2#018e5445f02271669136718db865e9bf43aa1ea3" + [[package]] name = "version_check" version = "0.9.4" @@ -2042,22 +2047,20 @@ dependencies = [ [[package]] name = "vte" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40eb22ae96f050e0c0d6f7ce43feeae26c348fc4dea56928ca81537cfaa6188b" +source = "git+https://github.com/zed-industries/vte?branch=osc-133-2#018e5445f02271669136718db865e9bf43aa1ea3" dependencies = [ "bitflags 2.6.0", "cursor-icon", "log", "serde", - "utf8parse", + "utf8parse 0.2.2 (git+https://github.com/zed-industries/vte?branch=osc-133-2)", "vte_generate_state_changes", ] [[package]] name = "vte_generate_state_changes" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" +source = "git+https://github.com/zed-industries/vte?branch=osc-133-2#018e5445f02271669136718db865e9bf43aa1ea3" dependencies = [ "proc-macro2", "quote", diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 72009d88875..32037c1f2fb 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -1749,7 +1749,10 @@ impl input::Processor> { TerminalEvent::PtyWrite(text) => self.ctx.write_to_pty(text.into_bytes()), TerminalEvent::MouseCursorDirty => self.reset_mouse_cursor(), TerminalEvent::CursorBlinkingChange => self.ctx.update_cursor_blinking(), - TerminalEvent::Exit | TerminalEvent::ChildExit(_) | TerminalEvent::Wakeup => (), + TerminalEvent::Exit + | TerminalEvent::ChildExit(_) + | TerminalEvent::Wakeup + | TerminalEvent::Osc133(_) => {}, }, #[cfg(unix)] EventType::IpcConfig(_) => (), diff --git a/alacritty_terminal/Cargo.toml b/alacritty_terminal/Cargo.toml index e643e081658..652fec23fc2 100644 --- a/alacritty_terminal/Cargo.toml +++ b/alacritty_terminal/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "alacritty_terminal" version = "0.24.1-dev" -authors = ["Christian Duerr ", "Joe Wilm "] +authors = [ + "Christian Duerr ", + "Joe Wilm ", +] license = "Apache-2.0" description = "Library for writing terminal emulators" readme = "../README.md" @@ -24,7 +27,10 @@ parking_lot = "0.12.0" polling = "3.0.0" regex-automata = "0.4.3" unicode-width = "0.1" -vte = { version = "0.13.0", default-features = false, features = ["ansi", "serde"] } +vte = { version = "0.13.0", default-features = false, features = [ + "ansi", + "serde", +], git = "https://github.com/zed-industries/vte", branch = "osc-133-2" } serde = { version = "1", features = ["derive", "rc"], optional = true } [target.'cfg(unix)'.dependencies] @@ -41,7 +47,7 @@ windows-sys = { version = "0.52.0", features = [ "Win32_System_LibraryLoader", "Win32_System_Threading", "Win32_System_WindowsProgramming", -]} +] } [dev-dependencies] serde_json = "1.0.0" diff --git a/alacritty_terminal/src/event.rs b/alacritty_terminal/src/event.rs index e17d41eabe0..bce62ea6637 100644 --- a/alacritty_terminal/src/event.rs +++ b/alacritty_terminal/src/event.rs @@ -55,6 +55,8 @@ pub enum Event { /// Child process exited with an error code. ChildExit(i32), + + Osc133(vte::ansi::Osc133Command), } impl Debug for Event { @@ -73,6 +75,7 @@ impl Debug for Event { Event::Bell => write!(f, "Bell"), Event::Exit => write!(f, "Exit"), Event::ChildExit(code) => write!(f, "ChildExit({code})"), + Event::Osc133(command) => write!(f, "Osc133({command:?})") } } } diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 8a0410dc343..fe9cc1f66a5 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -2236,6 +2236,12 @@ impl Handler for Term { let text = format!("\x1b[8;{};{}t", self.screen_lines(), self.columns()); self.event_proxy.send_event(Event::PtyWrite(text)); } + + #[inline] + fn handle_osc133(&mut self, command: vte::ansi::Osc133Command) { + println!("OSC 133 command: {:?}", command); + self.event_proxy.send_event(Event::Osc133(command)); + } } /// The state of the [`Mode`] and [`PrivateMode`].