diff --git a/crates/remote/src/transport/wsl.rs b/crates/remote/src/transport/wsl.rs index d91a0d742cd711148ca81f583e982b3836508a57..702b2dd0601ab94969d1c88de6b6eaae8951c9b2 100644 --- a/crates/remote/src/transport/wsl.rs +++ b/crates/remote/src/transport/wsl.rs @@ -98,21 +98,10 @@ impl WslRemoteConnection { let args = &["-m"]; let output = wsl_command_impl(options, &program, args, true) .output() - .await?; - - if !output.status.success() { - let output = wsl_command_impl(options, &program, args, false) - .output() - .await?; - - if !output.status.success() { - return Err(anyhow!( - "Command '{}' failed: {}", - program, - String::from_utf8_lossy(&output.stderr).trim() - )); - } + .await; + if !output.is_ok_and(|output| output.status.success()) { + run_wsl_command_impl(options, &program, args, false).await?; Ok(false) } else { Ok(true)