We discovered in https://github.com/r-lib/lifecycle/issues/167 that cli::num_ansi_colors() is slow when called interactively in RStudio due to rstudioapi::versionInfo() being fairly slow. versionInfo() is slow due to having to call readCitationFile(), and in cli the citation bit isn't required at all. The only things it uses are the $version and the $mode.
getVersion() gives us fast (in theory, see #279) access to $version. It would be nice to also have getMode() that cli could use to have fast access to the $mode.
Similar to #279
We discovered in https://github.com/r-lib/lifecycle/issues/167 that
cli::num_ansi_colors()
is slow when called interactively in RStudio due torstudioapi::versionInfo()
being fairly slow.versionInfo()
is slow due to having to callreadCitationFile()
, and in cli the citation bit isn't required at all. The only things it uses are the$version
and the$mode
.getVersion()
gives us fast (in theory, see #279) access to$version
. It would be nice to also havegetMode()
that cli could use to have fast access to the$mode
.