cli
cli copied to clipboard
Progress bar should use `stderr()` inside knitr documents
e.g. create an .Rmd that contains this and knitr it from the IDE:
```{r}
cli::cli_progress_bar(total = 20)
for (i in 1:20) {
cli::cli_progress_update()
Sys.sleep(0.2)
}
```
The progress bar should appear in the Render pane (i.e. stderr()) rather than appearing in the output. (And I'd expect it to only be updated every 3 seconds).
Same problem when I deploy to connect: https://connect.rstudioservices.com/connect/#/apps/9d8f2425-7d4b-430f-b3b1-29b328d335da/logs/3028
Somewhat related to this is that if the background thread if off, like in webR, then currently there are no (timed) progress updates. If we fix the update interval here, then we might as well fix that.
I can only second this issue.
It would be really nice to be able to conveniently use progress bars in via purrr.
The knitrProgressBar package works, but of course a "direct" solution would be nicer.
Currently, I am using this work-around:
pb <- knitrProgressBar::progress_estimated(100)
purrr::walk(1:100, \(i) {
Sys.sleep(0.03)
knitrProgressBar::update_progress(pb)
})
Is there a workaround for this? like setting an option. I feel like it should hide in non-interactive output.