Skip to content

Progress bar does not display until after the first item is complete #1648

Closed

Description

@max-sixty

Take this example:

    with click.progressbar(length=6, label="Doing something") as bar:
        for thing in [3, 2, 1]:
            time.sleep(thing)
            bar.update(thing)

This shows nothing until three seconds, at which point it shows:

Doing something  [##################------------------]   50%  00:00:03

Would it be reasonable for it to display a 0% at first?
This is mostly an issue with a small number of items which take a long time.

Activity

  1. davidism commented on Aug 16, 2020

    @davidism
    Member

    Duplicate of #1353.

  2. max-sixty commented on Aug 17, 2020

    @max-sixty
    ContributorAuthor

    I saw that issue – fine if you prefer to group them. It's not necessarily the same issue though: would be possible to display the last item and start showing from the 0th item.

  3. locked as resolved and limited conversation to collaborators on Nov 13, 2020
  4. unlocked this conversation on Mar 4, 2021
  5. davidism commented on Mar 4, 2021

    @davidism
    Member

    This was introduced in #487. I just ran into the same confusion when fixing the tests for #1353/#1354, the first line of progress wasn't shown and it wasn't clear why. Reading #487, I'm not convinced by the reasoning, if you have a fast machine or fast process, it doesn't hurt to output the progress bar. I'm going to revert that.

    Maybe it would make sense to somehow hide the progress bar if all iterations finish quickly, but otherwise you end up in this weird situation where the bar displays late because the first iteration is always "fast". I don't see a simple way to implement that though, and in general want to avoid adding complexity to Click's progress bar at this point.

  6. added this to the 8.0.0 milestone on Mar 4, 2021
  7. self-assigned this
    on Mar 4, 2021
  8. locked as resolved and limited conversation to collaborators on Mar 19, 2021
  9. added
    help output
    and removed on Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

help output

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions