From c932dd193568ec2f5fc31cce0bf5f03c733c740e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=83=D0=B7=D0=BD=D0=B5=D1=86=D0=BE=D0=B2=20=D0=9C?= =?UTF-8?q?=D0=B0=D0=BA=D1=81=D0=B8=D0=BC?= Date: Sat, 14 Feb 2026 11:17:29 +0300 Subject: [PATCH] recent_projects: Check for WSL paths in OpenFolderInWsl (#49156) Closes #42842 Previously, OpenFolderInWsl action assumed a valid path is on the host and failed to open paths inside the WSL filesystem (accessed through UNC) Now the action checks for a WSL path and opens it with the appropriate distro (skipping the choice modal) This was manually confirmed to not regress as well as work with WSL paths. Code was written by hand, with extra checking by OpenAI Codex. Release Notes: - Fixed paths inside the WSL filesystem failing to open when using "open folder in wsl" --- crates/recent_projects/src/recent_projects.rs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs index a3b51d894469b0571b90695f747b8c35e647f8e7..09ba8200e06198f7bb2ce8984e423449dccaf711 100644 --- a/crates/recent_projects/src/recent_projects.rs +++ b/crates/recent_projects/src/recent_projects.rs @@ -230,6 +230,9 @@ pub fn init(cx: &mut App) { cx, ); + let app_state = workspace.app_state().clone(); + let window_handle = window.window_handle().downcast::(); + cx.spawn_in(window, async move |workspace, cx| { use util::paths::SanitizedPath; @@ -237,6 +240,32 @@ pub fn init(cx: &mut App) { return; }; + let wsl_path = paths + .iter() + .find_map(util::paths::WslPath::from_path); + + if let Some(util::paths::WslPath { distro, path }) = wsl_path { + use remote::WslConnectionOptions; + + let connection_options = RemoteConnectionOptions::Wsl(WslConnectionOptions { + distro_name: distro.to_string(), + user: None, + }); + + let replace_window = match create_new_window { + false => window_handle, + true => None, + }; + + let open_options = workspace::OpenOptions { + replace_window, + ..Default::default() + }; + + open_remote_project(connection_options, vec![path.into()], app_state, open_options, cx).await.log_err(); + return; + } + let paths = paths .into_iter() .filter_map(|path| SanitizedPath::new(&path).local_to_wsl())