Respect quarto.cells.useReticulate setting in Positron - #1116
Merged
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
vezwork
approved these changes
Sep 9, 2026
Member
There was a problem hiding this comment.
The code change is simple and good. Tested in Positron daily confirmed that by default (when the useReticulate setting is on) python cells in a qmd with an r cell get sent to the r console with reticulate. When the setting is off, they get sent to the python console.
Looking forward to command+enter being fixed to respect the setting as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses posit-dev/positron#6675 in part
This PR fixes a bug in Positron. Before this change, Positron ignored the
quarto.cells.useReticulatesetting. When you ran a Python cell in a document withengine: knitr, Positron always rewrote the code to run in the R console throughreticulate::repl_python(...). The setting had no effect. Now the Positron cell execution path checks the same setting that the default VS Code host already uses.I also added a regression test. The test runs a knitr Python cell with the setting off. It shows that the cell executes in the Python console instead of R.
Known limitation
This change does not solve the full problem in the issue about the difference between running a statement and Run Cell. In Positron, Cmd+Enter (run the current statement) sends the command to Positron core's
positron.executeCodeFromPositioncommand. This command always runs Python cells on the Python console. It does not check thequarto.cells.useReticulatesetting, and this extension has no hook to change that path. As a result, with the setting on, Run Cell now goes to R through reticulate, but Run Line still goes to Python. A fix for that part of the issue needs a change in Positron itself.Validation steps
yarn test-positronpasses (includes the new test)With a
.qmdfile that has both anrchunk and apythonchunk:R cells run the same way, with the setting on or off
Switching the setting on and off again repeats this same behavior each time