Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

remote: Polish for connection progress & error dialogs (#19379)

Shish2db9090a2f96
diff --git a/crates/recent_projects/src/ssh_connections.rs b/crates/recent_projects/src/ssh_connections.rs
index c8043acc48f..814126e9f97 100644
--- a/crates/recent_projects/src/ssh_connections.rs
+++ b/crates/recent_projects/src/ssh_connections.rs
@@ -175,7 +175,7 @@ impl Render for SshPrompt {
.child(
h_flex()
.p_2()
- .flex_wrap()
+ .flex()
.child(if self.error_message.is_some() {
Icon::new(IconName::XCircle)
.size(IconSize::Medium)
@@ -195,6 +195,7 @@ impl Render for SshPrompt {
})
.child(
div()
+ .ml_1()
.text_ellipsis()
.overflow_x_hidden()
.when_some(self.error_message.as_ref(), |el, error| {
@@ -205,7 +206,7 @@ impl Render for SshPrompt {
|el| {
el.child(
Label::new(format!(
- "-{}…",
+ "{}…",
self.status_message.clone().unwrap()
))
.size(LabelSize::Small),
diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rs
index 38bb6d05b71..f7ef74ce392 100644
--- a/crates/remote/src/ssh_session.rs
+++ b/crates/remote/src/ssh_session.rs
@@ -1321,7 +1321,10 @@ impl SshRemoteConnection {
let mut stderr = master_process.stderr.take().unwrap();
stderr.read_to_end(&mut output).await?;
- let error_message = format!("failed to connect: {}", String::from_utf8_lossy(&output));
+ let error_message = format!(
+ "failed to connect: {}",
+ String::from_utf8_lossy(&output).trim()
+ );
delegate.set_error(error_message.clone(), cx);
Err(anyhow!(error_message))?;
}
@@ -1382,14 +1385,14 @@ impl SshRemoteConnection {
let server_mode = 0o755;
let t0 = Instant::now();
- delegate.set_status(Some("uploading remote development server"), cx);
+ delegate.set_status(Some("Uploading remote development server"), cx);
log::info!("uploading remote development server ({}kb)", size / 1024);
self.upload_file(&src_path, &dst_path_gz)
.await
.context("failed to upload server binary")?;
log::info!("uploaded remote development server in {:?}", t0.elapsed());
- delegate.set_status(Some("extracting remote development server"), cx);
+ delegate.set_status(Some("Extracting remote development server"), cx);
run_cmd(
self.socket
.ssh_command("gunzip")
@@ -1398,7 +1401,7 @@ impl SshRemoteConnection {
)
.await?;
- delegate.set_status(Some("unzipping remote development server"), cx);
+ delegate.set_status(Some("Marking remote development server executable"), cx);
run_cmd(
self.socket
.ssh_command("chmod")