diff --git a/src/remote.ts b/src/remote.ts index 76a534d9..cf47f965 100644 --- a/src/remote.ts +++ b/src/remote.ts @@ -444,6 +444,12 @@ export class Remote { if (!sshConfigFile) { sshConfigFile = path.join(os.homedir(), ".ssh", "config") } + // VS Code Remote resolves ~ to the home directory. + // This is required for the tilde to work on Windows. + if (sshConfigFile.startsWith("~")) { + sshConfigFile = path.join(os.homedir(), sshConfigFile.slice(1)) + } + const sshConfig = new SSHConfig(sshConfigFile) await sshConfig.load()