Skip to content

Commit 98a6958

Browse files
authored
Revert "fix: Avoid double escaping of ProxyCommand on Windows (#3664)" (#3704)
This reverts commit 123fe01.
1 parent 6a00baf commit 98a6958

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

cli/configssh.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,10 @@ func configSSH() *cobra.Command {
280280
"\tLogLevel ERROR",
281281
)
282282
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, "\"", "\\\"")
287283
if !wireguard {
288-
//nolint:gocritic // We don't want to use %q here, see above.
289-
configOptions = append(configOptions, fmt.Sprintf("\tProxyCommand \"%s\" --global-config \"%s\" ssh --stdio %s", escapedBinaryFile, root, hostname))
284+
configOptions = append(configOptions, fmt.Sprintf("\tProxyCommand %q --global-config %q ssh --stdio %s", binaryFile, root, hostname))
290285
} else {
291-
//nolint:gocritic // We don't want to use %q here, see above.
292-
configOptions = append(configOptions, fmt.Sprintf("\tProxyCommand \"%s\" --global-config \"%s\" ssh --wireguard --stdio %s", escapedBinaryFile, root, hostname))
286+
configOptions = append(configOptions, fmt.Sprintf("\tProxyCommand %q --global-config %q ssh --wireguard --stdio %s", binaryFile, root, hostname))
293287
}
294288
}
295289

0 commit comments

Comments
 (0)