cli
cli copied to clipboard
cli R package progress bars not showing if multiple progress bars created in quick succession
If I create multiple {cli} progress bars in quick succession, only the first progress bar is shown. However, if I add a short timer with Sys.sleep(0.2), all progress bars are shown:
options(cli.progress_show_after = 0)
fun <- function(step) {
cli::cli_progress_bar(
clear = FALSE
)
cli::cli_progress_update(inc = 0)
cli::cli_progress_done()
}
fun_sleep <- function(step) {
cli::cli_progress_bar(
clear = FALSE
)
cli::cli_progress_update(inc = 0)
cli::cli_progress_done()
Sys.sleep(0.2)
}
purrr::walk(1:3, function(x) fun(x))
purrr::walk(1:3, function(x) fun_sleep(x))
How do I show all progress bars without needing to use Sys.sleep(0.2)?
Cross posted on stackoverflow: https://stackoverflow.com/questions/76204800/cli-r-package-progress-bars-not-showing
Seems like a bug to me.
I'm finding this to be the case for me as well. Worked perfectly on R v4.2.1 on my M1 mac, but after updating to 4.3 on my M1 it won't display anything.