diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index 6fb2558af1d..97c4c4a24e6 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -69,6 +69,10 @@ All changes included in 1.8: - ([#12753](https://github.com/quarto-dev/quarto-cli/issues/12753)): Support change in IPython 9+ and import `set_matplotlib_formats` from `matplotlib_inline.backend_inline` in the internal `setup.py` script used to initialize rendering with Jupyter engine. +### `knitr` + +- Correctly detect R binary on Windows when `R_HOME` is set - this fixes issue with `quarto::quarto_render()` that will now correctly use the same R version as the R session it is called from. + ## Other fixes and improvements - ([#11321](https://github.com/quarto-dev/quarto-cli/issues/11321)): Follow [recommendation from LaTeX project](https://latex-project.org/news/latex2e-news/ltnews40.pdf) and use `lualatex` instead of `xelatex` as the default PDF engine. diff --git a/src/core/resources.ts b/src/core/resources.ts index 89b2642cafc..b5efd15ecf6 100644 --- a/src/core/resources.ts +++ b/src/core/resources.ts @@ -117,7 +117,7 @@ export async function rBinaryPath( const rHome = Deno.env.get("R_HOME"); debug(`Looking for '${binary}' in R_HOME: ${rHome}`); if (rHome) { - let rHomeBin = join(rHome, "bin", binary); + let rHomeBin = join(rHome, "bin", isWindows ? binary + ".exe" : binary); if (safeExistsSync(rHomeBin)) { debug(`Found in ${rHomeBin}`); return setPath(rHomeBin);