mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Update so that WindowsTerminal uses sixel for images previews
This commit is contained in:
parent
69e7c8ff0d
commit
921fc0bdae
2 changed files with 12 additions and 6 deletions
|
|
@ -82,14 +82,17 @@ impl Adapter {
|
||||||
|
|
||||||
impl Adapter {
|
impl Adapter {
|
||||||
pub fn matches() -> Self {
|
pub fn matches() -> Self {
|
||||||
let mut protocols = Emulator::detect().adapters();
|
let emulator = Emulator::detect();
|
||||||
|
let mut protocols = emulator.clone().adapters();
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
protocols.retain(|p| *p == Self::Iterm2);
|
if !matches!(emulator, Emulator::WindowsTerminal) {
|
||||||
if env_exists("ZELLIJ_SESSION_NAME") {
|
protocols.retain(|p| *p == Self::Iterm2);
|
||||||
protocols.retain(|p| *p == Self::Sixel);
|
if env_exists("ZELLIJ_SESSION_NAME") {
|
||||||
} else if *TMUX {
|
protocols.retain(|p| *p == Self::Sixel);
|
||||||
protocols.retain(|p| *p != Self::KittyOld);
|
} else if *TMUX {
|
||||||
|
protocols.retain(|p| *p != Self::KittyOld);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if let Some(p) = protocols.first() {
|
if let Some(p) = protocols.first() {
|
||||||
return *p;
|
return *p;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ pub enum Emulator {
|
||||||
Neovim,
|
Neovim,
|
||||||
Apple,
|
Apple,
|
||||||
Urxvt,
|
Urxvt,
|
||||||
|
WindowsTerminal
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Emulator {
|
impl Emulator {
|
||||||
|
|
@ -46,6 +47,7 @@ impl Emulator {
|
||||||
Self::Neovim => vec![],
|
Self::Neovim => vec![],
|
||||||
Self::Apple => vec![],
|
Self::Apple => vec![],
|
||||||
Self::Urxvt => vec![],
|
Self::Urxvt => vec![],
|
||||||
|
Self::WindowsTerminal => vec![Adapter::Sixel]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -64,6 +66,7 @@ impl Emulator {
|
||||||
("GHOSTTY_RESOURCES_DIR", Self::Ghostty),
|
("GHOSTTY_RESOURCES_DIR", Self::Ghostty),
|
||||||
("VSCODE_INJECTION", Self::VSCode),
|
("VSCODE_INJECTION", Self::VSCode),
|
||||||
("TABBY_CONFIG_DIRECTORY", Self::Tabby),
|
("TABBY_CONFIG_DIRECTORY", Self::Tabby),
|
||||||
|
("WT_Session", Self::WindowsTerminal),
|
||||||
];
|
];
|
||||||
match vars.into_iter().find(|v| env_exists(v.0)) {
|
match vars.into_iter().find(|v| env_exists(v.0)) {
|
||||||
Some(var) => return var.1,
|
Some(var) => return var.1,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue