ssh kitten: Fix -o RemoteCommand handling

This commit is contained in:
Kovid Goyal
2026-04-15 05:19:22 +05:30
parent a9e56d52a0
commit a47093a7bf
2 changed files with 11 additions and 11 deletions

View File

@@ -201,13 +201,15 @@ type SSHConfig struct {
}
// ReadSSHConfig Asynchronously read ssh configuration
func ReadSSHConfig(ctx context.Context, hostname string) <-chan *SSHConfig {
func ReadSSHConfig(ctx context.Context, ssh_args []string, hostname string) <-chan *SSHConfig {
ch := make(chan *SSHConfig, 1)
go func() {
defer close(ch)
cmd_args := []string{SSHExe(), hostname, "-G"}
cmd_args := []string{SSHExe(), "-G"}
cmd_args = append(cmd_args, ssh_args...)
cmd_args = append(cmd_args, hostname)
cmd := exec.CommandContext(ctx, cmd_args[0], cmd_args[1:]...)
var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout