Skip to content

Commit e453183

Browse files
authored
fix: allow ~ to work when resolving remote.SSH.configFile on Windows (#68)
1 parent 8a47fc1 commit e453183

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/remote.ts

+6
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,12 @@ export class Remote {
444444
if (!sshConfigFile) {
445445
sshConfigFile = path.join(os.homedir(), ".ssh", "config")
446446
}
447+
// VS Code Remote resolves ~ to the home directory.
448+
// This is required for the tilde to work on Windows.
449+
if (sshConfigFile.startsWith("~")) {
450+
sshConfigFile = path.join(os.homedir(), sshConfigFile.slice(1))
451+
}
452+
447453
const sshConfig = new SSHConfig(sshConfigFile)
448454
await sshConfig.load()
449455

0 commit comments

Comments
 (0)