diff --git a/R/stubs.R b/R/stubs.R index 1f52d1e..b1f1139 100644 --- a/R/stubs.R +++ b/R/stubs.R @@ -426,13 +426,17 @@ hasColorConsole <- function() { #' #' #' @param command A command (as a string) to be run after restarting. +#' @param clean Boolean; when `FALSE`, the current \R session (including +#' loaded packages and data objects) will be saved and restored in the +#' new session. #' #' @note The \code{restartSession} function was added in version 1.1.281 of -#' RStudio. +#' RStudio. Support for the `clean` argument was added for version 2024.04 +#' release of RStudio; it is silently ignored in older versions of RStudio. #' #' @export -restartSession <- function(command = "") { - callFun("restartSession", command) +restartSession <- function(command = "", clean = FALSE) { + callFun("restartSession", command, clean) } diff --git a/man/restartSession.Rd b/man/restartSession.Rd index 4114d53..fc07664 100644 --- a/man/restartSession.Rd +++ b/man/restartSession.Rd @@ -4,15 +4,20 @@ \alias{restartSession} \title{Restart the R Session} \usage{ -restartSession(command = "") +restartSession(command = "", clean = FALSE) } \arguments{ \item{command}{A command (as a string) to be run after restarting.} + +\item{clean}{Boolean; when \code{FALSE}, the current \R session (including +loaded packages and data objects) will be saved and restored in the +new session.} } \description{ Restart the RStudio session. } \note{ The \code{restartSession} function was added in version 1.1.281 of -RStudio. +RStudio. Support for the \code{clean} argument was added for version 2024.04 +release of RStudio; it is silently ignored in older versions of RStudio. }