From 298bbd9b9ce7736f6b0dfd63690eedd7b703b458 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Wed, 17 Oct 2018 15:26:56 +0200 Subject: [PATCH] extract username from putty hostname if not set --- src/connect.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/connect.ts b/src/connect.ts index c645b4c..c09656b 100644 --- a/src/connect.ts +++ b/src/connect.ts @@ -41,6 +41,9 @@ export async function calculateActualConfig(config: FileSystemConfig): Promise= 1) { + config.username = session.hostname.substr(0, session.hostname.indexOf('@')); + } config.host = config.host || session.hostname; config.port = session.portnumber || config.port; config.agent = config.agent || (session.tryagent ? 'pageant' : undefined);