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

Commit

Permalink
don't include full path for preview file when running on WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Oct 26, 2022
1 parent 4432b77 commit e57bc61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.52.0 (Unreleased)

- Don't include full path for preview file when running on WSL

## 1.51.0 (Release on 24 October 2022)

- Always render on save for notebooks (as they don't execute by default)
Expand Down
5 changes: 5 additions & 0 deletions src/providers/preview/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ class PreviewManager {
);
}

// are we running in wsl?
const isWsl = vscode.env.remoteName === "wsl";

// is this is a shiny doc?
const isShiny = await isQuartoShinyDoc(this.engine_, doc);

Expand All @@ -417,6 +420,8 @@ class PreviewManager {
shQuote(
this.quartoContext_.useCmd
? target.fsPath
: isWsl
? path.basename(target.fsPath)
: pathWithForwardSlashes(target.fsPath)
),
];
Expand Down

0 comments on commit e57bc61

Please sign in to comment.