Skip to content

Commit 9860ad8

Browse files
maxbrunsfeldnotpeter
authored andcommitted
Revert "Remote: Change "sh -c" to "sh -lc" (#36760)" (#37417)
This reverts commit bf5ed6d. We believe this may be breaking some users whose shell initialization scripts change the working directory. Release Notes: - N/A
1 parent 2d27a1a commit 9860ad8

File tree

1 file changed

+6
-6
lines changed
  • crates/remote/src/transport

1 file changed

+6
-6
lines changed

crates/remote/src/transport/ssh.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl RemoteConnection for SshRemoteConnection {
263263

264264
let ssh_proxy_process = match self
265265
.socket
266-
.ssh_command("sh", &["-lc", &start_proxy_command])
266+
.ssh_command("sh", &["-c", &start_proxy_command])
267267
// IMPORTANT: we kill this process when we drop the task that uses it.
268268
.kill_on_drop(true)
269269
.spawn()
@@ -640,7 +640,7 @@ impl SshRemoteConnection {
640640
.run_command(
641641
"sh",
642642
&[
643-
"-lc",
643+
"-c",
644644
&shell_script!("mkdir -p {parent}", parent = parent.to_string().as_ref()),
645645
],
646646
)
@@ -718,7 +718,7 @@ impl SshRemoteConnection {
718718
.run_command(
719719
"sh",
720720
&[
721-
"-lc",
721+
"-c",
722722
&shell_script!("mkdir -p {parent}", parent = parent.to_string().as_ref()),
723723
],
724724
)
@@ -766,7 +766,7 @@ impl SshRemoteConnection {
766766
dst_path = &dst_path.to_string()
767767
)
768768
};
769-
self.socket.run_command("sh", &["-lc", &script]).await?;
769+
self.socket.run_command("sh", &["-c", &script]).await?;
770770
Ok(())
771771
}
772772

@@ -1123,7 +1123,7 @@ impl SshSocket {
11231123
}
11241124

11251125
async fn platform(&self) -> Result<RemotePlatform> {
1126-
let uname = self.run_command("sh", &["-lc", "uname -sm"]).await?;
1126+
let uname = self.run_command("sh", &["-c", "uname -sm"]).await?;
11271127
let Some((os, arch)) = uname.split_once(" ") else {
11281128
anyhow::bail!("unknown uname: {uname:?}")
11291129
};
@@ -1154,7 +1154,7 @@ impl SshSocket {
11541154
}
11551155

11561156
async fn shell(&self) -> String {
1157-
match self.run_command("sh", &["-lc", "echo $SHELL"]).await {
1157+
match self.run_command("sh", &["-c", "echo $SHELL"]).await {
11581158
Ok(shell) => shell.trim().to_owned(),
11591159
Err(e) => {
11601160
log::error!("Failed to get shell: {e}");

0 commit comments

Comments
 (0)