diff --git a/crates/remote/src/remote_client.rs b/crates/remote/src/remote_client.rs index 91eb5c5a2fe..c645a31d129 100644 --- a/crates/remote/src/remote_client.rs +++ b/crates/remote/src/remote_client.rs @@ -385,7 +385,7 @@ pub async fn connect( ) -> Result> { cx.update(|cx| { cx.update_default_global(|pool: &mut ConnectionPool, cx| { - pool.connect(connection_options.clone(), delegate.clone(), cx) + pool.connect(connection_options.clone(), None, delegate.clone(), cx) }) }) .await @@ -684,7 +684,12 @@ impl RemoteClient { let (remote_connection, io_task) = match async { let remote_connection = cx .update_global(|pool: &mut ConnectionPool, cx| { - pool.connect(connection_options, delegate.clone(), cx) + pool.connect( + connection_options, + Some(remote_connection.remote_platform().os), + delegate.clone(), + cx, + ) }) .await .map_err(|error| error.cloned())?; @@ -1231,6 +1236,7 @@ impl ConnectionPool { fn connect( &mut self, opts: RemoteConnectionOptions, + known_os: Option, delegate: Arc, cx: &mut App, ) -> Shared, Arc>>> { @@ -1270,7 +1276,7 @@ impl ConnectionPool { async move |cx| { let connection = match opts.clone() { RemoteConnectionOptions::Ssh(opts) => { - SshRemoteConnection::new(opts, delegate, cx) + SshRemoteConnection::new(opts, known_os, delegate, cx) .await .map(|connection| Arc::new(connection) as Arc) } diff --git a/crates/remote/src/transport/ssh.rs b/crates/remote/src/transport/ssh.rs index c13e39b9582..5c9ab757162 100644 --- a/crates/remote/src/transport/ssh.rs +++ b/crates/remote/src/transport/ssh.rs @@ -633,6 +633,7 @@ async fn find_existing_control_master( impl SshRemoteConnection { pub(crate) async fn new( connection_options: SshConnectionOptions, + known_os: Option, delegate: Arc, cx: &mut AsyncApp, ) -> Result { @@ -788,7 +789,10 @@ impl SshRemoteConnection { (socket, Some(master_process)) }; - let is_windows = socket.probe_is_windows().await; + let is_windows = match known_os { + Some(os) => os.is_windows(), + None => socket.probe_is_windows().await, + }; log::info!("Remote is windows: {}", is_windows); let ssh_shell = socket.shell(is_windows).await;