Skip to content

Commit 10e3551

Browse files
committed
fix: Use /bin/sh as the main ssh session shell
Previously nerdlog was using the login shell via ssh (which was causing problems with shells like `fish`), and locally it was using `/usr/bin/env bash`, which is a bit insonsistent with the ssh conns. Note that we can't remove the dependency on `bash` completely yet, because the agent script still relies on bash-specific features and it's not easy to change (e.g. I do want to use the `PIPESTATUS` and there's no real equivalent in POSIX). But at least the main ssh session doesn't need any bash-specific features, and using `/bin/sh` is the most reasonable thing there.
1 parent 04cbe37 commit 10e3551

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/shell_transport_local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (s *ShellTransportLocal) doConnect(
4747

4848
// Start the local shell command
4949
// TODO: make it configurable; e.g. it likely won't work on Windows
50-
cmd := exec.Command("/usr/bin/env", "bash")
50+
cmd := exec.Command("/bin/sh")
5151
stdin, err := cmd.StdinPipe()
5252
if err != nil {
5353
res.Err = errors.Annotatef(err, "getting stdin pipe")

core/shell_transport_ssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (st *ShellTransportSSH) doConnect(
128128
return res
129129
}
130130

131-
err = sshSession.Shell()
131+
err = sshSession.Start("/bin/sh")
132132
if err != nil {
133133
res.Err = errors.Annotatef(err, conf.Descr)
134134
return res

0 commit comments

Comments
 (0)