config: Replace winapi with windows-sys (#8098)
This commit is contained in:
1 parent
70c036a236
commit
78cd82dbba
3 files changed
+6
-3
No files matched your search
Generated
+1
-1
@@ -983,7 +983,7 @@ dependencies = [
|
||||
"wezterm-input-types",
|
||||
"wezterm-ssh",
|
||||
"wezterm-term",
|
||||
"winapi",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
+1
-1
@@ -47,4 +47,4 @@ wezterm-term = { workspace = true, features=["use_serde"] }
|
||||
nix = {workspace=true, features=["resource"]}
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
winapi = { workspace=true, features = ["winuser"]}
|
||||
windows-sys = { workspace = true, features = ["Win32_System_Threading"] }
|
||||
+4
-1
@@ -49,11 +49,14 @@ impl WslDistro {
|
||||
pub fn load_distro_list() -> anyhow::Result<Vec<Self>> {
|
||||
#[cfg(windows)]
|
||||
use std::os::windows::process::CommandExt;
|
||||
#[cfg(windows)]
|
||||
use windows_sys::Win32::System::Threading::CREATE_NO_WINDOW;
|
||||
|
||||
let mut cmd = std::process::Command::new("wsl.exe");
|
||||
cmd.arg("-l");
|
||||
cmd.arg("-v");
|
||||
#[cfg(windows)]
|
||||
cmd.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW);
|
||||
cmd.creation_flags(CREATE_NO_WINDOW);
|
||||
let output = cmd.output()?;
|
||||
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
|
||||
Reference in new issue
Block a user