mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
remote: Fix wsl interop detection failing on some setups (#49708)
Closes https://github.com/zed-industries/zed/issues/49697 Release Notes: - Fixed interop detection on WSL not working on newer setups
This commit is contained in:
parent
10a7987837
commit
be6f27cb8e
2 changed files with 10 additions and 4 deletions
|
|
@ -132,11 +132,17 @@ impl WslRemoteConnection {
|
|||
}
|
||||
|
||||
async fn detect_has_wsl_interop(&self) -> Result<bool> {
|
||||
Ok(self
|
||||
let interop = match self
|
||||
.run_wsl_command_with_output("cat", &["/proc/sys/fs/binfmt_misc/WSLInterop"])
|
||||
.await
|
||||
.inspect_err(|err| log::error!("Failed to detect wsl interop: {err}"))?
|
||||
.contains("enabled"))
|
||||
{
|
||||
Ok(interop) => interop,
|
||||
Err(err) => self
|
||||
.run_wsl_command_with_output("cat", &["/proc/sys/fs/binfmt_misc/WSLInterop-late"])
|
||||
.await
|
||||
.inspect_err(|err2| log::error!("Failed to detect wsl interop: {err}; {err2}"))?,
|
||||
};
|
||||
Ok(interop.contains("enabled"))
|
||||
}
|
||||
|
||||
async fn windows_path_to_wsl_path(&self, source: &Path) -> Result<String> {
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ pub fn execute_run(
|
|||
|
||||
let is_wsl_interop = if cfg!(target_os = "linux") {
|
||||
// See: https://learn.microsoft.com/en-us/windows/wsl/filesystems#disable-interoperability
|
||||
matches!(std::fs::read_to_string("/proc/sys/fs/binfmt_misc/WSLInterop"), Ok(s) if s.contains("enabled"))
|
||||
matches!(std::fs::read_to_string("/proc/sys/fs/binfmt_misc/WSLInterop").or_else(|_| std::fs::read_to_string("/proc/sys/fs/binfmt_misc/WSLInterop-late")), Ok(s) if s.contains("enabled"))
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue