Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remote: Change "sh -c" to "sh -lc" to make config in $HOME/.profile effective (#36760)
Rui Ningbf5ed6d1c979
diff --git a/crates/remote/src/ssh_session.rs b/crates/remote/src/ssh_session.rsindex b9af5286439..67940184705 100644--- a/crates/remote/src/ssh_session.rs+++ b/crates/remote/src/ssh_session.rs@@ -445,7 +445,7 @@ impl SshSocket {}async fn platform(&self) -> Result<SshPlatform> {- let uname = self.run_command("sh", &["-c", "uname -sm"]).await?;+ let uname = self.run_command("sh", &["-lc", "uname -sm"]).await?;let Some((os, arch)) = uname.split_once(" ") else {anyhow::bail!("unknown uname: {uname:?}")};@@ -476,7 +476,7 @@ impl SshSocket {}async fn shell(&self) -> String {- match self.run_command("sh", &["-c", "echo $SHELL"]).await {+ match self.run_command("sh", &["-lc", "echo $SHELL"]).await {Ok(shell) => shell.trim().to_owned(),Err(e) => {log::error!("Failed to get shell: {e}");@@ -1533,7 +1533,7 @@ impl RemoteConnection for SshRemoteConnection {let ssh_proxy_process = match self.socket- .ssh_command("sh", &["-c", &start_proxy_command])+ .ssh_command("sh", &["-lc", &start_proxy_command])// IMPORTANT: we kill this process when we drop the task that uses it..kill_on_drop(true).spawn()@@ -1910,7 +1910,7 @@ impl SshRemoteConnection {.run_command("sh",&[- "-c",+ "-lc",&shell_script!("mkdir -p {parent}", parent = parent.to_string().as_ref()),],)@@ -1988,7 +1988,7 @@ impl SshRemoteConnection {.run_command("sh",&[- "-c",+ "-lc",&shell_script!("mkdir -p {parent}", parent = parent.to_string().as_ref()),],)@@ -2036,7 +2036,7 @@ impl SshRemoteConnection {dst_path = &dst_path.to_string())};- self.socket.run_command("sh", &["-c", &script]).await?;+ self.socket.run_command("sh", &["-lc", &script]).await?;Ok(())}