r-lib / cli

Tools for making beautiful & useful command line interfaces
https://cli.r-lib.org/
Other
644 stars 70 forks source link

Rstudio progress bar handlers don't work by default #650

Open aquasync opened 10 months ago

aquasync commented 10 months ago

Using options(cli.progress_handlers='rstudio') doesn't work, due to cli:::builtin_handler_rstudio$able() returning FALSE.

Looking at the code for the function, it is checking that .Platform$GUI == "Rstudio", while for me at least (runnning RStudio 2022.07), it is "RStudio", with a capital S.

At the moment I can work around by doing options(cli.progress_handlers_only='rstudio'), as that bypasses the $able checks, but it would be better to just do a case-insensitive check (assuming that it was indeed Rstudio at some point in the past).

Thanks,

Charles