File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,17 @@ func (r *RootCmd) configSSH() *clibase.Cmd {
249
249
return xerrors .Errorf ("escape coder binary for ssh failed: %w" , err )
250
250
}
251
251
252
+ escapedHeaderCommand := ""
253
+
254
+ if r .headerCommand != "" {
255
+ headerCommand , err := sshConfigExecEscape (coderBinary , forceUnixSeparators )
256
+ if err != nil {
257
+ return xerrors .Errorf ("escape header command for ssh failed: %w" , err )
258
+ }
259
+
260
+ escapedHeaderCommand = headerCommand
261
+ }
262
+
252
263
root := r .createConfig ()
253
264
escapedGlobalConfig , err := sshConfigExecEscape (string (root ), forceUnixSeparators )
254
265
if err != nil {
@@ -389,8 +400,8 @@ func (r *RootCmd) configSSH() *clibase.Cmd {
389
400
390
401
if ! skipProxyCommand {
391
402
rootFlags := fmt .Sprintf ("--global-config %s" , escapedGlobalConfig )
392
- if r . headerCommand != "" {
393
- rootFlags += fmt .Sprintf (" --header-command %s" , r . headerCommand )
403
+ if escapedHeaderCommand != "" {
404
+ rootFlags += fmt .Sprintf (" --header-command %s" , escapedHeaderCommand )
394
405
}
395
406
396
407
flags := ""
You can’t perform that action at this time.
0 commit comments