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())