Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit e57bc61

Browse files
committed
don't include full path for preview file when running on WSL
1 parent 4432b77 commit e57bc61

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.52.0 (Unreleased)
4+
5+
- Don't include full path for preview file when running on WSL
6+
37
## 1.51.0 (Release on 24 October 2022)
48

59
- Always render on save for notebooks (as they don't execute by default)

src/providers/preview/preview.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,9 @@ class PreviewManager {
401401
);
402402
}
403403

404+
// are we running in wsl?
405+
const isWsl = vscode.env.remoteName === "wsl";
406+
404407
// is this is a shiny doc?
405408
const isShiny = await isQuartoShinyDoc(this.engine_, doc);
406409

@@ -417,6 +420,8 @@ class PreviewManager {
417420
shQuote(
418421
this.quartoContext_.useCmd
419422
? target.fsPath
423+
: isWsl
424+
? path.basename(target.fsPath)
420425
: pathWithForwardSlashes(target.fsPath)
421426
),
422427
];

0 commit comments

Comments
 (0)