Skip to content

Commit b1372c9

Browse files
committed
Obey handler for shell.
1 parent cf4d88d commit b1372c9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

execd.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,12 @@ func handleChannel(conn *ssh.ServerConn, newChan ssh.NewChannel, execHandler []s
341341
// TODO: Handle "shell" which technically comes after "pty-req".
342342
// TODO: Handle "window-change" for pty
343343
// TODO: Parse payload to set initial window dimensions
344-
// XXX: Obey handler
345-
cmd := exec.Command("/usr/local/bin/bash")
344+
var cmd *exec.Cmd
345+
if *shell {
346+
cmd = exec.Command(os.Getenv("SHELL"))
347+
} else {
348+
cmd = exec.Command(execHandler[0], execHandler[1:]...)
349+
}
346350
if !*env {
347351
cmd.Env = []string{}
348352
}

0 commit comments

Comments
 (0)