diff --git a/extensions/SSHSessionBackend/src/SSHSessionBackendExtension.ts b/extensions/SSHSessionBackend/src/SSHSessionBackendExtension.ts index 308c79af..5aa6e7bd 100644 --- a/extensions/SSHSessionBackend/src/SSHSessionBackendExtension.ts +++ b/extensions/SSHSessionBackend/src/SSHSessionBackendExtension.ts @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file. */ import * as child_process from "node:child_process"; +import * as fs from "node:fs"; import * as os from "node:os"; import * as path from "node:path"; @@ -30,6 +31,8 @@ interface SSHSessionConfiguration extends SessionConfiguration { verboseLogging?: boolean; } +const WINDOW_SSH_AUTH_SOCK = "\\\\.\\pipe\\openssh-ssh-agent"; + class SSHBackend implements SessionBackend { constructor(private _log: Logger) { @@ -102,6 +105,9 @@ class SSHBackend implements SessionBackend { } if (process.platform === "win32") { + if (fs.existsSync(WINDOW_SSH_AUTH_SOCK)) { + return WINDOW_SSH_AUTH_SOCK; + } return undefined; } else { return process.env.SSH_AUTH_SOCK;