Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
ssh remoting: Expand tilde on host side (#18333)
Thorsten Ballccc871c44c30
diff --git a/crates/project/src/worktree_store.rs b/crates/project/src/worktree_store.rsindex 9f25572fc7e..4b1764c3a87 100644--- a/crates/project/src/worktree_store.rs+++ b/crates/project/src/worktree_store.rs@@ -221,10 +221,11 @@ impl WorktreeStore {) -> Task<Result<Model<Worktree>, Arc<anyhow::Error>>> {let mut abs_path = abs_path.as_ref().to_string_lossy().to_string();// If we start with `/~` that means the ssh path was something like `ssh://user@host/~/home-dir-folder/`- // in which case want to strip the leading the `/` and expand the tilde.+ // in which case want to strip the leading the `/`.+ // On the host-side, the `~` will get expanded.// That's what git does too: https://github.com/libgit2/libgit2/issues/3345#issuecomment-127050850if abs_path.starts_with("/~") {- abs_path = shellexpand::tilde(&abs_path[1..]).to_string();+ abs_path = abs_path[1..].to_string();}let root_name = PathBuf::from(abs_path.clone()).file_name()diff --git a/crates/recent_projects/src/ssh_connections.rs b/crates/recent_projects/src/ssh_connections.rsindex ad23a5c8963..1722c58f075 100644--- a/crates/recent_projects/src/ssh_connections.rs+++ b/crates/recent_projects/src/ssh_connections.rs@@ -327,7 +327,14 @@ impl SshClientDelegate {cx,).await- .map_err(|e| anyhow::anyhow!("failed to download remote server binary: {}", e))?;+ .map_err(|e| {+ anyhow::anyhow!(+ "failed to download remote server binary (os: {}, arch: {}): {}",+ platform.os,+ platform.arch,+ e+ )+ })?;Ok((binary_path, version))}