Open jmgirard opened 2 years ago
IIUC this is already possible. We do it in usethis like so:
https://github.com/r-lib/usethis/blob/7c8e0049a1e40e6dcabbde069bb29576215a11b6/R/rstudio.R#L141-L163
@jennybc Thanks for the pointer. IIUC, the approach you linked (essentially calling rstudioapi::openProject()
) will work but only if the user has a project open. I get why this is a fine assumption for {usethis}, because if you're working on a package then you have a project open. But for my use case, it would be better to be able to restart RStudio even with no projects open. I considered initializing a new project, restarting, and then closing the current project, but there doesn't appear to be a way to close the current project in {rstudioapi}.
I am creating an addin that allows users to save and load RStudio preferences (inspired by https://github.com/rstudio/rstudio/issues/4276). Although I can use
applyTheme()
to update the theme, I am struggling to get RStudio to update its font (to match changes todesktop.ini
) without restarting. I can ask the user to restart RStudio manually, but I think it would be ideal if I could initiate a refresh from {rstudioapi} like occurs when exiting the Global Options menu.