diff --git a/src/extension.ts b/src/extension.ts index 3d1b805..ac1daee 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -168,7 +168,7 @@ export async function activate(context: vscode.ExtensionContext) { return; } - if (!path.isAbsolute(dir) && dir !== '~') { + if (!path.isAbsolute(dir) && dir !== '~' && !dir.startsWith('~/')) { vscode.window.showErrorMessage(`${dir} is an invalid absolute path`); return; } diff --git a/src/node-explorer-provider.ts b/src/node-explorer-provider.ts index 98972b2..67cc8f3 100644 --- a/src/node-explorer-provider.ts +++ b/src/node-explorer-provider.ts @@ -96,6 +96,9 @@ export class NodeExplorerProvider const homeDir = await this.fsProvider.getHomeDirectory(element.Address); if (rootDir && rootDir !== '~') { + if (rootDir.startsWith('~/')) { + rootDir = `${homeDir}/${rootDir.slice(2)}`; + } dirDesc = trimPathPrefix(rootDir, homeDir); } else { rootDir = homeDir;