Skip to content

Commit

Permalink
feat: use kitty image protocol in ghostty
Browse files Browse the repository at this point in the history
  • Loading branch information
mfontanini committed Dec 14, 2024
1 parent ec192d1 commit 2220ce4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/media/emulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub enum TerminalEmulator {
Mlterm,
St,
Xterm,
Ghostty,
Unknown,
}

Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit 2220ce4

Please sign in to comment.