mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-25 19:17:39 +03:00
parent
4346030459
commit
179acc1382
@ -18,6 +18,10 @@ import { SSHTabComponent } from '../components/sshTab.component'
|
||||
|
||||
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' })
|
||||
export class SSHService {
|
||||
private logger: Logger
|
||||
@ -193,7 +197,14 @@ export class SSHService {
|
||||
if (await fs.exists(WINDOWS_OPENSSH_AGENT_PIPE)) {
|
||||
agent = WINDOWS_OPENSSH_AGENT_PIPE
|
||||
} 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 {
|
||||
agent = process.env.SSH_AUTH_SOCK as string
|
||||
|
Loading…
Reference in New Issue
Block a user