From bb13228ad599dbb46d61f30ce0ae808df9c77e4d Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 3 Sep 2025 14:24:32 -0700 Subject: [PATCH] Revert "Remote: Change "sh -c" to "sh -lc" (#36760)" (#37417) This reverts commit bf5ed6d1c9795369310b5b9d6c752d9dc54991b5. We believe this may be breaking some users whose shell initialization scripts change the working directory. Release Notes: - N/A --- crates/remote/src/transport/ssh.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/remote/src/transport/ssh.rs b/crates/remote/src/transport/ssh.rs index 0995e0dd611ae667cc2e68638773c8b80bf2f22b..42c6da04b5c39b0b1133b2d13549585fa9433ef7 100644 --- a/crates/remote/src/transport/ssh.rs +++ b/crates/remote/src/transport/ssh.rs @@ -254,7 +254,7 @@ impl RemoteConnection for SshRemoteConnection { let ssh_proxy_process = match self .socket - .ssh_command("sh", &["-lc", &start_proxy_command]) + .ssh_command("sh", &["-c", &start_proxy_command]) // IMPORTANT: we kill this process when we drop the task that uses it. .kill_on_drop(true) .spawn() @@ -529,7 +529,7 @@ impl SshRemoteConnection { .run_command( "sh", &[ - "-lc", + "-c", &shell_script!("mkdir -p {parent}", parent = parent.to_string().as_ref()), ], ) @@ -607,7 +607,7 @@ impl SshRemoteConnection { .run_command( "sh", &[ - "-lc", + "-c", &shell_script!("mkdir -p {parent}", parent = parent.to_string().as_ref()), ], ) @@ -655,7 +655,7 @@ impl SshRemoteConnection { dst_path = &dst_path.to_string() ) }; - self.socket.run_command("sh", &["-lc", &script]).await?; + self.socket.run_command("sh", &["-c", &script]).await?; Ok(()) } @@ -797,7 +797,7 @@ impl SshSocket { } async fn platform(&self) -> Result { - let uname = self.run_command("sh", &["-lc", "uname -sm"]).await?; + let uname = self.run_command("sh", &["-c", "uname -sm"]).await?; let Some((os, arch)) = uname.split_once(" ") else { anyhow::bail!("unknown uname: {uname:?}") }; @@ -828,7 +828,7 @@ impl SshSocket { } async fn shell(&self) -> String { - match self.run_command("sh", &["-lc", "echo $SHELL"]).await { + match self.run_command("sh", &["-c", "echo $SHELL"]).await { Ok(shell) => shell.trim().to_owned(), Err(e) => { log::error!("Failed to get shell: {e}");