Open hadley opened 1 year ago
Even more nitpicky, I noticed that if I run rmarkdown::render()
there are two blank lines before the progress bar starts:
> rmarkdown::render("delay.Rmd")
processing file: delay.Rmd
|........................ | 33% (alpha)
And maybe there's one extra empty line at the bottom too? (at least when run_pandoc = FALSE
).
> invisible(rmarkdown::render("delay.Rmd", run_pandoc = FALSE))
processing file: delay.Rmd
output file: delay.knit.md
>
Hmmm, the first problem (where "processing..." is interleaved in the output") might actually be an RStudio problem
It is an RStudio bug: https://github.com/rstudio/rstudio/issues/8160. knitr could work around it by outputing the "Process file" message to stdout()
instead of stderr()
. We have some techniques to do this in rlang/cli, but you could also just switch the message()
to cat()
.
@kevinushey pointed me to this article on why interleaving streams is generally hard: https://unix.stackexchange.com/questions/476080/what-prevents-stdout-stderr-from-interleaving/476089#476089. You might also argue that maybe the problem is that the progress bar is using stdout()
since everything that appears in this display will be using stderr()
Not 100% sure this is the same problem, but note that in this connnect log the progress bar shows up after the error.
This is almost surely an RStudio issue -- not sure if there's a way to replicate the same flow in a "regular" R instance outside of RStudio.
I am loving the new progress bar! But I noticed a couple of small issues exemplified by this simple Rmd: