Cmd + Enter doesn't run line in Quarto in RStudio with multiple source columns and Visual editor mode

When I have multiple source columns in RStudio (e.g. by View > Panes > Add Source Column), and one of the columns is a QMD, Command + Enter usually only runs the current line in one of the columns.

Cmd + Enter works when I first open the Quarto file, or if I click the tab of the Quarto file before running. Clicking into the file's window and selecting a line, though, isn't enough.

Reproduction steps.

  1. Create the files


print("Hello World")


title: "Untitled"
format: html

x <- "Goodbye Earth"
  1. Open fileA.R
  2. Open fileB.qmd with File > Open File in New Column (I have not found a difference depending on which file is opened first, or which column each file is in.)
  3. Set editor mode to "Visual" in Quarto file
  4. Place cursor in fileA.R, hit Command + Enter; view console output
  5. Place cursor in fileB.qmd, hit Command + Enter; view chunk and console output. It should* print "Hello World" from fileA.R instead of "Goodbye Earth" from fileB.qmd
  6. If step 5 properly prints "Goodbye Earth", then repeat steps 4 and 5. (Sometimes fileB.qmd runs properly when it's first opened for me.)
  7. Click the tab for fileB.qmd
  8. Place cursor on line in fileB.qmd, hit Command Enter; view the chunk and console output. For me it now prints "Goodbye Earth"

*"Should", as in, to imitate the problem I'm experiencing

Note that this only occurs with Visual editor mode and not Source (or markdown) editor mode for the QMD.

RStudio Version

Version 2023.06.1+524


R version 4.3.1 (2023-06-16)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.