diff --git a/Cargo.lock b/Cargo.lock index 9ea9b47c..70de14b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1055,6 +1055,17 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nix" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", +] + [[package]] name = "nom" version = "5.1.2" @@ -1914,7 +1925,7 @@ dependencies = [ "local_ipaddress", "log", "mockall", - "nix", + "nix 0.24.1", "notify-rust", "once_cell", "open", @@ -1963,7 +1974,7 @@ dependencies = [ "lazycell", "libc", "mach", - "nix", + "nix 0.23.1", "num-traits", "uom", "winapi", @@ -2546,7 +2557,7 @@ dependencies = [ "futures-util", "hex", "lazy_static", - "nix", + "nix 0.23.1", "once_cell", "ordered-stream", "rand 0.8.5", diff --git a/Cargo.toml b/Cargo.toml index 9a977d2d..673b753e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -105,7 +105,7 @@ features = [ ] [target.'cfg(not(windows))'.dependencies] -nix = "0.23.1" +nix = { version = "0.24.1", default-features = false, features = ["feature", "fs", "user"] } [build-dependencies] shadow-rs = "0.11.0" diff --git a/src/modules/git_status.rs b/src/modules/git_status.rs index 3f5c3f21..d90f8e8f 100644 --- a/src/modules/git_status.rs +++ b/src/modules/git_status.rs @@ -372,7 +372,12 @@ fn git_status_wsl(context: &Context, conf: &GitStatusConfig) -> Option { // Ensure this is WSL // This is lowercase in WSL1 and uppercase in WSL2, just skip the first letter - if !uname().release().contains("icrosoft") { + if !uname() + .ok()? + .release() + .to_string_lossy() + .contains("icrosoft") + { return None; }