tqdm/tqdm

CLI: Cannot mix `leave`

LecrisUT opened this issue · 0 comments

  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
  • I have visited the source website, and in particular
    read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:

Try out this sinppet

for it in a b c; do
  for itt in 1 2; do
    sleep 2
    echo $itt
  done | tqdm --desc "test2" --position=1 --leave=False --total=2 > /dev/null
  sleep 1
  echo $it
done | tqdm --desc "test" --leave=True --total=3 > /dev/null

Notice that the progress bar "test" does not appear until the first inner loop is finished. But if you try with similar leave parameter, the progress bar is displayed at the first run. This is a bit counter to what the user would typically want in case of slow applications where they want to see the overall progress, but do not want to have a long history of the inner ones.