feat: support image preview on WSL (#315)

This commit is contained in:
三咲雅 · Misaki Masa 2023-10-24 19:34:06 +08:00 committed by GitHub
parent b46e71a6bb
commit 8aeef55b6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,10 +57,14 @@ impl Adaptor {
_ => {}
}
match env::var("XDG_SESSION_TYPE").unwrap_or_default().as_str() {
"x11" => Self::X11,
"wayland" => Self::Wayland,
_ => Self::Chafa,
"x11" => return Self::X11,
"wayland" => return Self::Wayland,
_ => {}
}
if std::fs::symlink_metadata("/proc/sys/fs/binfmt_misc/WSLInterop").is_ok() {
return Self::Kitty;
}
Self::Chafa
}
pub(super) fn term_program() -> (String, String) {