diff --git a/crates/recent_projects/src/remote_servers.rs b/crates/recent_projects/src/remote_servers.rs index d360ba4233d036191617c89ffb92b9decced5002..0e15abf296e491185f24718cddf72e2532e9e6aa 100644 --- a/crates/recent_projects/src/remote_servers.rs +++ b/crates/recent_projects/src/remote_servers.rs @@ -488,18 +488,21 @@ impl ProjectPicker { }) .log_err(); - let options = cx - .update(|_, cx| (app_state.build_window_options)(None, cx)) - .log_err()?; - let window = cx - .open_window(options, |window, cx| { + let window = if create_new_window { + let options = cx + .update(|_, cx| (app_state.build_window_options)(None, cx)) + .log_err()?; + cx.open_window(options, |window, cx| { let workspace = cx.new(|cx| { telemetry::event!("SSH Project Created"); Workspace::new(None, project.clone(), app_state.clone(), window, cx) }); cx.new(|cx| MultiWorkspace::new(workspace, window, cx)) }) - .log_err()?; + .log_err() + } else { + cx.window_handle().downcast::() + }?; let items = open_remote_project_with_existing_connection( connection, project, paths, app_state, window, None, cx,