diff --git a/tabby-ssh/src/session/ssh.ts b/tabby-ssh/src/session/ssh.ts index f0da8f13..5174a0d1 100644 --- a/tabby-ssh/src/session/ssh.ts +++ b/tabby-ssh/src/session/ssh.ts @@ -306,6 +306,14 @@ export class SSHSession { this.authUsername = 'root' } } + if (this.authUsername?.startsWith('$')) { + try { + const result = process.env[this.authUsername.slice(1)] + this.authUsername = result ?? this.authUsername + } catch { + this.authUsername = 'root' + } + } ssh.connect({ host: this.profile.options.host.trim(), diff --git a/tabby-ssh/tsconfig.typings.json b/tabby-ssh/tsconfig.typings.json index 891a0f24..5446e796 100644 --- a/tabby-ssh/tsconfig.typings.json +++ b/tabby-ssh/tsconfig.typings.json @@ -10,6 +10,7 @@ "paths": { "tabby-*": ["../../tabby-*"], "*": ["../../app/node_modules/*"] - } + }, + "types": ["node"] } }