Bug 17193 - Console is cleared when using progress bar
Summary: Console is cleared when using progress bar
Alias: None
Product: R
Classification: Unclassified
Component: Windows GUI / Window specific (show other bugs)
Version: R 3.3.*
Hardware: x86_64/x64/amd64 (64-bit) Windows 64-bit
: P5 minor
Assignee: R-core
Depends on:
Reported: 2016-12-14 07:58 UTC by Jon Skoien
Modified: 2016-12-14 07:58 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jon Skoien 2016-12-14 07:58:23 UTC
I have noticed that the console is cleared after x iterations when the progress bar is called in a function which is wrapped in a loop. In the example below, this happened for me every ~44th iteration. Interestingly, it seems that reduction of the sleep times in this function increases the number of iterations before clearing. In my real application, where the progress bar is used in a much slower function, the console is cleared every 2-3 iteration, which means that I cannot scroll back to check the output.

testit <- function(x = sort(runif(20)), ...)
  pb <- txtProgressBar(...)
  for(i in c(0, x, 1)) {Sys.sleep(0.2); setTxtProgressBar(pb, i)}

iter = 0
while (TRUE) {testit(style = 3); iter = iter + 1; print(paste("done", iter))} 

This seems to be a Windows RGUI issue, I am not able to reproduce in RStudio, and AFAIK it has not been reproduced under Linux.