src/vs/workbench/contrib/terminal/browser/links/terminalLinkManager.ts/TerminalLinkManager/_resolvePath
class TerminalLinkManager:	private async _resolvePath(link: string, uri?: URI): Promise<ResolvedLink> {
		if (!this._processManager) {
			throw new Error('Process manager is required');
		}

		// Check resolved link cache first
		const cached = this._resolvedLinkCache.get(uri || link);
		if (cached !== undefined) {
			return cached;
		}

		if (uri) {
			try {
				const stat = await this._fileService.stat(uri);
				const result = { uri, link, isDirectory: stat.isDirectory };
				this._resolvedLinkCache.set(uri, result);
				return result;
			}
			catch (e) {
				// Does not exist
				this._resolvedLinkCache.set(uri, null);
				return null;
			}
		}

		const preprocessedLink = this._preprocessPath(link);
		if (!preprocessedLink) {
			this._resolvedLinkCache.set(link, null);
			return null;
		}

		const linkUrl = this.extractLinkUrl(preprocessedLink);
		if (!linkUrl) {
			this._resolvedLinkCache.set(link, null);
			return null;
		}

		try {
			let uri: URI;
			if (this._processManager.remoteAuthority) {
				uri = URI.from({
					scheme: Schemas.vscodeRemote,
					authority: this._processManager.remoteAuthority,
					path: linkUrl
				});
			} else {
				uri = URI.file(linkUrl);
			}

			try {
				const stat = await this._fileService.stat(uri);
				const result = { uri, link, isDirectory: stat.isDirectory };
				this._resolvedLinkCache.set(link, result);
				return result;
			}
			catch (e) {
				// Does not exist
				this._resolvedLinkCache.set(link, null);
				return null;
			}
		} catch {
			// Errors in parsing the path
			this._resolvedLinkCache.set(link, null);
			return null;
		}
	}