Skip to content

Commit e0c4d8d

Browse files
committed
Modify the path depending on VSCODE_PROXY_URI
thx to @benz0li
1 parent ccd2d09 commit e0c4d8d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/command/render/render-shared.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ export async function printBrowsePreviewMessage(
178178
info(`\nPreview server: ${previewURL(host, port, path = "")}`);
179179
info(`\nBrowse at ${url}`, { format: colors.green });
180180
} else if (isVSCodeTerminal() && isVSCodeServer()) {
181-
const sep = path.startsWith("/") ? "" : "/";
181+
if (vsCodeServerProxyUri().endsWith("/")) {
182+
path = path.startsWith("/") ? path.slice(1) : path;
183+
} else {
184+
path = path.startsWith("/") ? path : "/" + path;
185+
}
182186
const browseUrl = vsCodeServerProxyUri()!.replace("{{port}}", `${port}`) +
183187
sep + path;
184188
info(`\nBrowse at ${browseUrl}`, { format: colors.green });

0 commit comments

Comments
 (0)