From c5a0340a212c10c63e740cee0189dda0979c0260 Mon Sep 17 00:00:00 2001 From: Jean Pierre Date: Fri, 16 Dec 2022 06:52:45 -0500 Subject: [PATCH] Fixes #45 --- src/ssh/sshConfig.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ssh/sshConfig.ts b/src/ssh/sshConfig.ts index 06826d3..90488db 100644 --- a/src/ssh/sshConfig.ts +++ b/src/ssh/sshConfig.ts @@ -3,19 +3,19 @@ import * as fs from 'fs'; import * as path from 'path'; import SSHConfig, { Directive, Line, Section } from 'ssh-config'; import * as vscode from 'vscode'; -import { exists as fileExists } from '../common/files'; +import { exists as fileExists, untildify } from '../common/files'; import { isWindows } from '../common/platform'; const systemSSHConfig = isWindows ? path.resolve(process.env.ALLUSERSPROFILE || 'C:\\ProgramData', 'ssh\\ssh_config') : '/etc/ssh/ssh_config'; const defaultSSHConfigPath = path.resolve(os.homedir(), '.ssh/config'); export function getSSHConfigPath() { - const remoteSSHconfig = vscode.workspace.getConfiguration('remote.SSH'); - return remoteSSHconfig.get('configFile') || defaultSSHConfigPath; + const sshConfigPath = vscode.workspace.getConfiguration('remote.SSH').get('configFile'); + return sshConfigPath ? untildify(sshConfigPath) : defaultSSHConfigPath; } function isDirective(line: Line): line is Directive { - return line.type === SSHConfig.DIRECTIVE + return line.type === SSHConfig.DIRECTIVE; } function isHostSection(line: Line): line is Section {