@@ -280,10 +280,16 @@ func configSSH() *cobra.Command {
280
280
"\t LogLevel ERROR" ,
281
281
)
282
282
if ! skipProxyCommand {
283
+ // In SSH configs, strings inside "" are interpreted literally and there
284
+ // is no need to e.g. escape backslashes (common on Windows platforms).
285
+ // We will escape the quotes, though.
286
+ escapedBinaryFile := strings .ReplaceAll (binaryFile ,"\" " ,"\\ \" " )
283
287
if ! wireguard {
284
- configOptions = append (configOptions ,fmt .Sprintf ("\t ProxyCommand %q --global-config %q ssh --stdio %s" ,binaryFile ,root ,hostname ))
288
+ //nolint:gocritic // We don't want to use %q here, see above.
289
+ configOptions = append (configOptions ,fmt .Sprintf ("\t ProxyCommand\" %s\" --global-config\" %s\" ssh --stdio %s" ,escapedBinaryFile ,root ,hostname ))
285
290
}else {
286
- configOptions = append (configOptions ,fmt .Sprintf ("\t ProxyCommand %q --global-config %q ssh --wireguard --stdio %s" ,binaryFile ,root ,hostname ))
291
+ //nolint:gocritic // We don't want to use %q here, see above.
292
+ configOptions = append (configOptions ,fmt .Sprintf ("\t ProxyCommand\" %s\" --global-config\" %s\" ssh --wireguard --stdio %s" ,escapedBinaryFile ,root ,hostname ))
287
293
}
288
294
}
289
295