mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: use WAYLAND_DISPLAY and DISPLAY to detect X11/Wayland when XDG_SESSION_TYPE is not set
This commit is contained in:
parent
8aeef55b6f
commit
4f282b61cb
1 changed files with 5 additions and 0 deletions
|
|
@ -61,6 +61,11 @@ impl Adaptor {
|
||||||
"wayland" => return Self::Wayland,
|
"wayland" => return Self::Wayland,
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
if env::var_os("WAYLAND_DISPLAY").filter(|s| !s.is_empty()).is_some() {
|
||||||
|
return Self::Wayland;
|
||||||
|
}
|
||||||
|
if env::var_os("DISPLAY").filter(|s| !s.is_empty()).is_some() {
|
||||||
|
return Self::X11;
|
||||||
if std::fs::symlink_metadata("/proc/sys/fs/binfmt_misc/WSLInterop").is_ok() {
|
if std::fs::symlink_metadata("/proc/sys/fs/binfmt_misc/WSLInterop").is_ok() {
|
||||||
return Self::Kitty;
|
return Self::Kitty;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue