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 dev: Always upload binary in development mode (#19953)

Thorsten Ball0ba40bdfb8b6
diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rs
index ff6dfd77511..0f6c90de432 100644
--- a/crates/remote/src/ssh_session.rs
+++ b/crates/remote/src/ssh_session.rs
@@ -1736,13 +1736,19 @@ impl SshRemoteConnection {
}
}
- if self.is_binary_in_use(dst_path).await? {
- log::info!("server binary is opened by another process. not updating");
- delegate.set_status(
- Some("Skipping update of remote development server, since it's still in use"),
- cx,
- );
- return Ok(());
+ if cfg!(not(debug_assertions)) {
+ // When we're not in dev mode, we don't want to switch out the binary if it's
+ // still open.
+ // In dev mode, that's fine, since we often kill Zed processes with Ctrl-C and want
+ // to still replace the binary.
+ if self.is_binary_in_use(dst_path).await? {
+ log::info!("server binary is opened by another process. not updating");
+ delegate.set_status(
+ Some("Skipping update of remote development server, since it's still in use"),
+ cx,
+ );
+ return Ok(());
+ }
}
let upload_binary_over_ssh = self.socket.connection_options.upload_binary_over_ssh;