From e0c4d8d093ff454136c94d99c8d595b3583c63b3 Mon Sep 17 00:00:00 2001 From: Charles Teague Date: Tue, 15 Nov 2022 08:30:07 -0500 Subject: [PATCH] Modify the path depending on VSCODE_PROXY_URI thx to @benz0li --- src/command/render/render-shared.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/command/render/render-shared.ts b/src/command/render/render-shared.ts index 2f402b109b..6229760740 100644 --- a/src/command/render/render-shared.ts +++ b/src/command/render/render-shared.ts @@ -178,7 +178,11 @@ export async function printBrowsePreviewMessage( info(`\nPreview server: ${previewURL(host, port, path = "")}`); info(`\nBrowse at ${url}`, { format: colors.green }); } else if (isVSCodeTerminal() && isVSCodeServer()) { - const sep = path.startsWith("/") ? "" : "/"; + if (vsCodeServerProxyUri().endsWith("/")) { + path = path.startsWith("/") ? path.slice(1) : path; + } else { + path = path.startsWith("/") ? path : "/" + path; + } const browseUrl = vsCodeServerProxyUri()!.replace("{{port}}", `${port}`) + sep + path; info(`\nBrowse at ${browseUrl}`, { format: colors.green });