r-wasm / webr

The statistical language R compiled to WebAssembly via Emscripten, for use in web browsers and Node.
https://docs.r-wasm.org/webr/latest/
Other
848 stars 67 forks source link

progress bars from purrr doesn't render #411

Open StaffanBetner opened 5 months ago

StaffanBetner commented 5 months ago

This is a simple example that doesn't show an expected progress bar:

library(purrr)
walk(1:10, ~Sys.sleep(0.5), .progress = TRUE)
georgestagg commented 5 months ago

Thanks for reporting this! It looks like any kind of cli progress bars are not working in the webR demo application, not just from purrr.

HenrikBengtsson commented 5 months ago

FWIW, similarly, it looks like output to stdout/stderr cannot be refreshed/flushed while running, e.g.

for (kk in 0:99) { cat(sprintf("%3d\r", kk)); Sys.sleep(0.1); flush(stdout()) }; cat("\n")

Same for

for (kk in 0:99) { cat(sprintf("\r%3d", kk)); Sys.sleep(0.1); flush(stdout()) }; cat("\n")