From a19e263242488ecc8c76eb5b16af8185bb2e0f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Wed, 24 Jan 2024 09:11:11 +0800 Subject: [PATCH] feat: image preview in Tabby terminal (#569) --- README.md | 1 + yazi-adaptor/src/adaptor.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 3c776589..8067cf56 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ https://github.com/sxyazi/yazi/assets/17523360/92ff23fa-0cd5-4f04-b387-894c12265 | foot | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | | Ghostty | [Kitty old protocol](https://github.com/sxyazi/yazi/blob/main/yazi-adaptor/src/kitty_old.rs) | ✅ Built-in | | Black Box | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | +| Tabby | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | | Hyper | [Sixel graphics format](https://www.vt100.net/docs/vt3xx-gp/chapter14.html) | ✅ Built-in | | X11 / Wayland | Window system protocol | ☑️ Überzug++ required | | Fallback | [Chafa](https://hpjansson.org/chafa/) | ☑️ Überzug++ required | diff --git a/yazi-adaptor/src/adaptor.rs b/yazi-adaptor/src/adaptor.rs index c885ee53..f41f74e4 100644 --- a/yazi-adaptor/src/adaptor.rs +++ b/yazi-adaptor/src/adaptor.rs @@ -32,6 +32,7 @@ enum Emulator { Ghostty, BlackBox, VSCode, + Tabby, Hyper, Mintty, Neovim, @@ -50,6 +51,7 @@ impl Adaptor { ("WEZTERM_EXECUTABLE", Emulator::WezTerm), ("GHOSTTY_RESOURCES_DIR", Emulator::Ghostty), ("VSCODE_INJECTION", Emulator::VSCode), + ("TABBY_CONFIG_DIRECTORY", Emulator::Tabby), ]; match vars.into_iter().find(|v| env_exists(v.0)) { Some(var) => return var.1, @@ -63,6 +65,7 @@ impl Adaptor { "ghostty" => return Emulator::Ghostty, "BlackBox" => return Emulator::BlackBox, "vscode" => return Emulator::VSCode, + "Tabby" => return Emulator::Tabby, "Hyper" => return Emulator::Hyper, "mintty" => return Emulator::Mintty, _ => warn!("[Adaptor] Unknown TERM_PROGRAM: {program}"), @@ -88,6 +91,7 @@ impl Adaptor { Emulator::Ghostty => vec![Self::KittyOld], Emulator::BlackBox => vec![Self::Sixel], Emulator::VSCode => vec![Self::Sixel], + Emulator::Tabby => vec![Self::Sixel], Emulator::Hyper => vec![Self::Sixel], Emulator::Mintty => vec![Self::Iterm2], Emulator::Neovim => vec![],