From 2220ce4cf3295557ec8ef404400aa2231cb18fb6 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Sat, 14 Dec 2024 12:15:13 -0800 Subject: [PATCH] feat: use kitty image protocol in ghostty --- src/media/emulator.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/media/emulator.rs b/src/media/emulator.rs index 3f20576..2bf292e 100644 --- a/src/media/emulator.rs +++ b/src/media/emulator.rs @@ -15,6 +15,7 @@ pub enum TerminalEmulator { Mlterm, St, Xterm, + Ghostty, Unknown, } @@ -64,13 +65,14 @@ impl TerminalEmulator { TerminalEmulator::Mlterm => term == "mlterm", TerminalEmulator::St => term == "st-256color", TerminalEmulator::Xterm => ["xterm", "xterm-256color"].contains(&term), + TerminalEmulator::Ghostty => term_program.contains("ghostty"), TerminalEmulator::Unknown => true, } } fn supports_graphics_mode(&self, mode: &GraphicsMode) -> bool { match (mode, self) { - (GraphicsMode::Kitty { mode, inside_tmux }, Self::Kitty | Self::WezTerm) => match mode { + (GraphicsMode::Kitty { mode, inside_tmux }, Self::Kitty | Self::WezTerm | Self::Ghostty) => match mode { KittyMode::Local => local_mode_supported(*inside_tmux).unwrap_or_default(), KittyMode::Remote => true, },