From be6f27cb8e74948b214c8c33592434c4b197b61b Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 20 Feb 2026 12:51:49 +0100 Subject: [PATCH] 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 --- crates/remote/src/transport/wsl.rs | 12 +++++++++--- crates/remote_server/src/server.rs | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/remote/src/transport/wsl.rs b/crates/remote/src/transport/wsl.rs index 69619f13c2c93ed77b782696f0bd85bcb55e2427..2eb2aea59abdbe24a3dae168d4399aaa59a9c6e3 100644 --- a/crates/remote/src/transport/wsl.rs +++ b/crates/remote/src/transport/wsl.rs @@ -132,11 +132,17 @@ impl WslRemoteConnection { } async fn detect_has_wsl_interop(&self) -> Result { - 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 { diff --git a/crates/remote_server/src/server.rs b/crates/remote_server/src/server.rs index 12af7f954927d8d99146c5a6fb1cf5461f0c6bb6..6f0cf3003309988bdc276e5e8ed9d34ed4c64c81 100644 --- a/crates/remote_server/src/server.rs +++ b/crates/remote_server/src/server.rs @@ -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 };