Merge pull request #65 from schrej/feature/username-in-putty-hostname

extract username from putty hostname if not set
pull/84/head
Kelvin Schoofs 6 years ago committed by GitHub
commit 146c57637f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,6 +41,9 @@ export async function calculateActualConfig(config: FileSystemConfig): Promise<F
if (!session) throw new Error(`Couldn't find the requested PuTTY session`);
if (session.protocol !== 'ssh') throw new Error(`The requested PuTTY session isn't a SSH session`);
config.username = config.username || session.username;
if (!config.username && session.hostname && session.hostname.indexOf('@') >= 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);

Loading…
Cancel
Save