Skip to content

Missing separating blank line option #295

Description

@Somerandomguy10111

Hey,
close this issue if this is actually possible, but I couldnt figure out for the life of me how to include a blank line to seperate the progress bar from the rest of the text streams when wrapping stdout/stderr.

I think that this is an important quality of life feature for a progressbar. See the attached image below for how it looks when installing/removing apt packages.

image

Apart from this, great library. Simple and reliable.

Activity

  1. changed the title [-]Seperating blank line[/-] [+]Missing separating blank line option[/+] on Apr 29, 2024
  2. Somerandomguy10111 commented on Apr 29, 2024

    @Somerandomguy10111
    Author

    Edit: I just discovered the init argument "line_offset". However, line_offset = 1 doesn't seem to achieve the desired effect. It seems to suppress any stdout printing at all

    -> ProgressBar(line_offset=0)
    image

    -> ProgressBar(line_offset=1)
    image

  3. wolph commented on Apr 29, 2024

    @wolph
    Owner

    You can try the line_offset parameter, it's meant for multiple parallel progress bars but it should work for this: https://progressbar-2.readthedocs.io/en/latest/index.html#showing-multiple-independent-progress-bars-in-parallel

  4. Somerandomguy10111 commented on Apr 29, 2024

    @Somerandomguy10111
    Author

    I tried it, but with this code I don't see any of the "test text messages" being printed, nor the "Program launched! for that matter. I only see the progress bar.

    -> Code (using python 3.10)

    import time
    import progressbar
    
    progressbar.streams.wrap_stderr()
    progressbar.streams.wrap_stdout()
    
    start_val = 0
    max_val = 20
    
    print(f'Program launched!')
    for k in progressbar.ProgressBar(start_val,max_val, line_offset=1):
        print(f'-> test text message')
        time.sleep(0.1)
    

    -> Output
    image

  5. wolph commented on May 1, 2024

    @wolph
    Owner

    You're right, it doesn't work right now :)
    I've tested a little and I don't think any option does what you need currently.

  6. reopened this on Jun 7, 2024
  7. reopened this on Jul 15, 2024
  8. added 2 commits that reference this issue on Jun 20, 2026
  9. wolph commented on Jul 18, 2026

    @wolph
    Owner

    Added the opt-in redirect_blank_line option, which keeps a blank line between redirected stdout/stderr output and the bar. Locked by tests/test_terminal.py::test_redirect_blank_line_position (asserts placement between the clear sequence and the redraw) added in #326. Closing.

  10. added a commit that references this issue on Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions