Repository navigation
Description
System details
RStudio 2026.01.2+418 "Apple Blossom" Release (1d903d3, 2026-03-25) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2026.01.2+418 Chrome/140.0.7339.249 Electron/38.7.2 Safari/537.36, Quarto 1.8.25
Steps to reproduce the problem
- Open a runnable R-Shiny script, in this case
app-run.R - Click the Run App button with Run in Window option checked
- Attempt to close the window after app loads
- Observe the window will not close, it will gray out but will not close or refresh regardless of any subsequent action except for quitting RStudio
Describe the problem in detail
Using app-run.R one-liner shiny::runApp() with the UI options Run in Window and Run in R Console both checked, the resulting window cannot be closed after stopping app (from window or console), or even after closing project and re-opening a different project. The window is grayed out like any disconnected shiny app, in the latter example showing a completely different app, but the window will not close unless RStudio is quit. Moreover, after stopping the app and then running again, the window does not refresh out of its gray/disconnected status indicating that it's orphaned somehow. The only way to interact with the running app is to use Open in Browser from the inactive window.
Describe the behavior you expected
I would expect some method (or any combination of methods) to close app window without resorting to quit Rstudio -- most especially clicking X on any window should always result in a window closing. I would also expect the window to reflect current state of current app -- grayed out if stopped, not grayed out if running, always for the currently loaded app.
- I have read the guide for submitting good bug reports.
- I have installed the latest version of RStudio, and confirmed that the issue still persists.
- If I am reporting an RStudio crash, I have included a diagnostics report.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Activity
ronblum commentedon Apr 22, 2026
@dataspun Thank you for raising the issue! I'm unable to reproduce, though, in the same environment. A few things:
app-run.R. Do you meanapp.Ror is this intentionally a different name?dataspun commentedon Apr 22, 2026
@ronblum thanks for following up.
app-run.Rbecause it plays nicely with Positron and VS Code shiny extension. But even withglobal.Rorserver.Rthe outcome is the same. That is, clicking Run App button with Window option checked leads to an orphaned window after initial attempt to stop/close.[-]Shiny app-run window orphaned[/-][+]Shiny app window orphaned[/+]ronblum commentedon Apr 23, 2026
@dataspun Thanks! A few more things:
shinyare you using? I want to set my environment as close as possible to yours.dataspun commentedon Apr 24, 2026
@ronblum
"Globemaster Allium" Release (57f8932, 2026-04-18) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2026.04.0+526 Chrome/142.0.7444.265 Electron/39.8.7 Safari/537.36, Quarto 1.9.36
rdesktop.logrsession-user.logronblum commentedon Apr 24, 2026
@dataspun Thanks! And darn, but was worth a shot. OK--I'll mark this for review.
ronblum commentedon May 4, 2026
See also #17502 for another example of this.
fix shiny app window becoming unclosable and orphaned (#17920)