mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 17:16:03 +00:00
@@ -18,6 +18,10 @@ import { SSHTabComponent } from '../components/sshTab.component'
|
|||||||
|
|
||||||
const WINDOWS_OPENSSH_AGENT_PIPE = '\\\\.\\pipe\\openssh-ssh-agent'
|
const WINDOWS_OPENSSH_AGENT_PIPE = '\\\\.\\pipe\\openssh-ssh-agent'
|
||||||
|
|
||||||
|
try {
|
||||||
|
var windowsProcessTreeNative = require('windows-process-tree/build/Release/windows_process_tree.node') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
|
||||||
|
} catch { }
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SSHService {
|
export class SSHService {
|
||||||
private logger: Logger
|
private logger: Logger
|
||||||
@@ -193,7 +197,14 @@ export class SSHService {
|
|||||||
if (await fs.exists(WINDOWS_OPENSSH_AGENT_PIPE)) {
|
if (await fs.exists(WINDOWS_OPENSSH_AGENT_PIPE)) {
|
||||||
agent = WINDOWS_OPENSSH_AGENT_PIPE
|
agent = WINDOWS_OPENSSH_AGENT_PIPE
|
||||||
} else {
|
} else {
|
||||||
agent = 'pageant'
|
const pageantRunning = new Promise<boolean>(resolve => {
|
||||||
|
windowsProcessTreeNative.getProcessList(list => { // eslint-disable-line block-scoped-var
|
||||||
|
resolve(list.some(x => x.name === 'pageant.exe'))
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
if (pageantRunning) {
|
||||||
|
agent = 'pageant'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
agent = process.env.SSH_AUTH_SOCK as string
|
agent = process.env.SSH_AUTH_SOCK as string
|
||||||
|
Reference in New Issue
Block a user