mirror of
https://github.com/zed-industries/zed.git
synced 2026-08-31 02:21:14 +00:00
Fix wsl path parsing (#43295)
Closes #40286 Release Notes: - N/A --------- Co-authored-by: John Tur <john-tur@outlook.com>
This commit is contained in:
parent
4376eb8217
commit
bfe141ea79
1 changed files with 3 additions and 4 deletions
|
|
@ -178,14 +178,13 @@ fn parse_path_in_wsl(source: &str, wsl: &str) -> Result<String> {
|
|||
.arg("--distribution")
|
||||
.arg(distro_name)
|
||||
.arg("--exec")
|
||||
.arg("wslpath")
|
||||
.arg("-m")
|
||||
.arg("realpath")
|
||||
.arg("-s")
|
||||
.arg(&source.path)
|
||||
.output()?;
|
||||
|
||||
let result = String::from_utf8_lossy(&output.stdout);
|
||||
let prefix = format!("//wsl.localhost/{}", distro_name);
|
||||
source.path = Path::new(result.trim().strip_prefix(&prefix).unwrap_or(&result)).to_owned();
|
||||
source.path = Path::new(result.trim()).to_owned();
|
||||
|
||||
Ok(source.to_string(|path| path.to_string_lossy().into_owned()))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue