diff --git a/src/vs/base/common/labels.ts b/src/vs/base/common/labels.ts index 7730a5dbf80e51b98237685c92e985a8615dce56..12244546332f476ce00e2935f77b88a1221b84d2 100644 --- a/src/vs/base/common/labels.ts +++ b/src/vs/base/common/labels.ts @@ -106,6 +106,14 @@ export function tildify(path: string, userHome: string): string { return path; } +export function untildify(path: string, userHome: string): string { + if (platform.isMacintosh || platform.isLinux) { + path = path.replace(/^~($|\/|\\)/, `${userHome}$1`); + } + + return path; +} + /** * Shortens the paths but keeps them easy to distinguish. * Replaces not important parts with ellipsis. diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index 4e2a304219957366d6f07cb0e9bd14a01d969540..3a85e381b07cecd46d26408d9f7ff304641901a4 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -142,6 +142,9 @@ export class OpenFileHandler extends QuickOpenHandler { return TPromise.as(new FileQuickOpenModel([])); } + // Untildify file pattern + searchValue = labels.untildify(searchValue, this.environmentService.userHome); + // Do find results return this.doFindResults(searchValue, this.cacheState.cacheKey, maxSortedResults); }