mirror of
https://github.com/Eugeny/tabby.git
synced 2026-08-24 10:14:31 -05:00
fix(ssh): fix windows openssh agent detection logic (#10954)
On Windows, checking for the existence of the OpenSSH agent named pipe (`\\.\pipe\openssh-ssh-agent`) can throw an `EBUSY` error if the agent is running and the pipe is in use. Previously, this error was caught generically and treated as the pipe not existing, causing auto-detection to fail even when the agent was active. This change updates the detection logic to explicitly catch `EBUSY` errors from `fs.stat` and treat them as a positive signal that the pipe exists.
This commit is contained in:
@@ -248,7 +248,17 @@ export class SSHSession {
|
||||
private async getAgentConnectionSpec (): Promise<russh.AgentConnectionSpec|null> {
|
||||
if (this.hostApp.platform === Platform.Windows) {
|
||||
if (this.config.store.ssh.agentType === 'auto') {
|
||||
if (await fs.exists(WINDOWS_OPENSSH_AGENT_PIPE)) {
|
||||
let pipeExists = false
|
||||
try {
|
||||
await fs.stat(WINDOWS_OPENSSH_AGENT_PIPE)
|
||||
pipeExists = true
|
||||
} catch (e) {
|
||||
if (e.code === 'EBUSY') {
|
||||
pipeExists = true
|
||||
}
|
||||
}
|
||||
|
||||
if (pipeExists) {
|
||||
return {
|
||||
kind: 'named-pipe',
|
||||
path: WINDOWS_OPENSSH_AGENT_PIPE,
|
||||
|
||||
Reference in New Issue
Block a user