Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Oct 24, 2023
1 parent 7e81eaf commit 7973331
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yazi-adaptor/src/adaptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl Adaptor {
"foot-extra" => return Self::Sixel,
_ => warn!("[Adaptor] Unknown TERM: {term}"),
}

match env::var("XDG_SESSION_TYPE").unwrap_or_default().as_str() {
"x11" => return Self::X11,
"wayland" => return Self::Wayland,
Expand All @@ -68,11 +69,12 @@ impl Adaptor {
}
if env::var_os("DISPLAY").is_some_and(|s| !s.is_empty()) {
return Self::X11;
}
if std::fs::symlink_metadata("/proc/sys/fs/binfmt_misc/WSLInterop").is_ok() {
return Self::Kitty;
}

warn!("[Adaptor] WAYLAND_DISPLAY and DISPLAY are both empty");
warn!("[Adaptor] Falling back to chafa");
Self::Chafa
}

Expand Down

0 comments on commit 7973331

Please sign in to comment.