rstudio / rstudioapi

Safely access RStudio's API (when available)
http://rstudio.github.io/rstudioapi
Other
165 stars 35 forks source link

rstudioapi::executeCommand("viewerClearAll") does not clear viewer pane #294

Open HJAllen opened 5 months ago

HJAllen commented 5 months ago

System details

RStudio Edition : Desktop
RStudio Version : 2023.12.0 Build 369
OS Version      : Windows 11
R Version       : 4.3.1

Steps to reproduce the problem

library(ggplot2)
library(plotly)
d <- data.frame(x = 1:10, y = 1:10)
ggplotly(
  ggplot(d) +
  geom_point(aes(x, y)))
rstudioapi::executeCommand("viewerClear")
rstudioapi::executeCommand("viewerClearAll")

Describe the problem in detail

The Posit Workbench Administration Guide lists commands which can be submitted through the rstudioapi including viewerClear and viewerClearAll. When submitting these commands in an attempt to clear the viewer, nothing happens. Other viewer commands like viewerPopout work as expected.

Describe the behavior you expected

Expected behavior is for the viewer pane to be cleared.