File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,8 @@ func shellAction(cmd *cobra.Command, args []string) error {
212212 if err != nil {
213213 return err
214214 }
215- sshArgs := sshutil .SSHArgsFromOpts (sshOpts )
215+ sshArgs := append ([]string {}, sshExe .Args ... )
216+ sshArgs = append (sshArgs , sshutil .SSHArgsFromOpts (sshOpts )... )
216217 if isatty .IsTerminal (os .Stdout .Fd ()) || isatty .IsCygwinTerminal (os .Stdout .Fd ()) {
217218 // required for showing the shell prompt: https://stackoverflow.com/a/626574
218219 sshArgs = append (sshArgs , "-t" )
@@ -235,8 +236,7 @@ func shellAction(cmd *cobra.Command, args []string) error {
235236 "--" ,
236237 script ,
237238 }... )
238- allArgs := append (sshExe .Args , sshArgs ... )
239- sshCmd := exec .Command (sshExe .Exe , allArgs ... )
239+ sshCmd := exec .Command (sshExe .Exe , sshArgs ... )
240240 sshCmd .Stdin = os .Stdin
241241 sshCmd .Stdout = os .Stdout
242242 sshCmd .Stderr = os .Stderr
Original file line number Diff line number Diff line change @@ -98,7 +98,8 @@ func tunnelAction(cmd *cobra.Command, args []string) error {
9898 if err != nil {
9999 return err
100100 }
101- sshArgs := sshutil .SSHArgsFromOpts (sshOpts )
101+ sshArgs := append ([]string {}, sshExe .Args ... )
102+ sshArgs = append (sshArgs , sshutil .SSHArgsFromOpts (sshOpts )... )
102103 sshArgs = append (sshArgs , []string {
103104 "-q" , // quiet
104105 "-f" , // background
@@ -107,8 +108,7 @@ func tunnelAction(cmd *cobra.Command, args []string) error {
107108 "-p" , strconv .Itoa (inst .SSHLocalPort ),
108109 inst .SSHAddress ,
109110 }... )
110- allArgs := append (sshExe .Args , sshArgs ... )
111- sshCmd := exec .Command (sshExe .Exe , allArgs ... )
111+ sshCmd := exec .Command (sshExe .Exe , sshArgs ... )
112112 sshCmd .Stdout = stderr
113113 sshCmd .Stderr = stderr
114114 logrus .Debugf ("executing ssh (may take a long)): %+v" , sshCmd .Args )
Original file line number Diff line number Diff line change @@ -387,9 +387,10 @@ func detectOpenSSHInfo(sshExe SSHExe) openSSHInfo {
387387 return * info
388388 }
389389 }
390+ sshArgs := append ([]string {}, sshExe .Args ... )
390391 // -V should be last
391- allArgs : = append (sshExe . Args , "-o" , "GSSAPIAuthentication=no" , "-V" )
392- cmd := exec .Command (sshExe .Exe , allArgs ... )
392+ sshArgs = append (sshArgs , "-o" , "GSSAPIAuthentication=no" , "-V" )
393+ cmd := exec .Command (sshExe .Exe , sshArgs ... )
393394 cmd .Stderr = & stderr
394395 if err := cmd .Run (); err != nil {
395396 logrus .Warnf ("failed to run %v: stderr=%q" , cmd .Args , stderr .String ())
You can’t perform that action at this time.
0 commit comments