From 5173a1a968d1aa716269736a39283c461d406608 Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Thu, 29 May 2025 08:55:29 +0530 Subject: [PATCH] recent_projects: Fix remote projects not regaining focus after SSH server connect (#31651) Closes #28071 Release Notes: - Fixed issue preventing remote projects modal from regaining focus after a successful SSH server connection. --- crates/recent_projects/src/remote_servers.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/recent_projects/src/remote_servers.rs b/crates/recent_projects/src/remote_servers.rs index e1b8032fcea12947109c28bb960baf0dbe5f871b..017d3e3d2b902e08ecaf66de9ea1337848f43ae5 100644 --- a/crates/recent_projects/src/remote_servers.rs +++ b/crates/recent_projects/src/remote_servers.rs @@ -474,14 +474,15 @@ impl RemoteServerProjects { .prompt_err("Failed to connect", window, cx, |_, _, _| None); let address_editor = editor.clone(); - let creating = cx.spawn(async move |this, cx| { + let creating = cx.spawn_in(window, async move |this, cx| { match connection.await { Some(Some(client)) => this - .update(cx, |this, cx| { + .update_in(cx, |this, window, cx| { telemetry::event!("SSH Server Created"); this.retained_connections.push(client); this.add_ssh_server(connection_options, cx); this.mode = Mode::default_mode(cx); + this.focus_handle(cx).focus(window); cx.notify() }) .log_err(),