Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bar spamming in new lines depending on window width #132

Open
Zacrain opened this issue May 21, 2024 · 0 comments
Open

Progress bar spamming in new lines depending on window width #132

Zacrain opened this issue May 21, 2024 · 0 comments

Comments

@Zacrain
Copy link

Zacrain commented May 21, 2024

I wonder whether it's intentional that the progress bar is spammed across a terminal if the terminal's window width is not wide enough for printing the complete progress bar. If it's wide enough, the progress bar updates in-place, which is good. But I encountered that it starts spamming if it's too narrow.

Is there a way to prevent this despite using a forced carriage return from my side?

Here a picture of how my progress bar looks like if the window is sufficiently wide:
image

Vs. too narrow:
image

This can be influenced by setting the bar width option of the progress bar. However, doesn't seem like a preferable solution to me as it is then depending on the user's terminal and display settings.

Running on Ubuntu 20.04 using the default Ubuntu bash terminal.

vawale added a commit to vawale/indicators that referenced this issue Jun 27, 2024
When the terminal width is too small, we run into problems as mentioned
in p-ranav#132. This PR fixes the
problem by keeping track of number of wrapped lines printed by progress
bar and erasing those extra wrapped lines before printing progress for
next iteration.

For multi_progress bar and dynamic_progress bar, we need to move cursor
to start before each iteration by summing up number of wrapped lines for
each bar. Since each bar's `print_progress` expects cursor to be on last
printed line, we move cursor down by number of wrapped lines before
printing progress for each bar.

I have not yet handled case when `dynamic_progress` option
`hide_bar_when_complete` is set.

Fixes Issue p-ranav#132
vawale added a commit to vawale/indicators that referenced this issue Jul 2, 2024
When the terminal width is too small, we run into problems as mentioned
in p-ranav#132. This PR fixes the
problem by keeping track of number of wrapped lines printed by progress
bar and erasing those extra wrapped lines before printing progress for
next iteration.

For multi_progress bar and dynamic_progress bar, we need to move cursor
to start before each iteration by summing up number of wrapped lines for
each bar. Since each bar's `print_progress` expects cursor to be on last
printed line, we move cursor down by number of wrapped lines before
printing progress for each bar.

I have not yet handled case when `dynamic_progress` option
`hide_bar_when_complete` is set.

Fixes Issue p-ranav#132
vawale added a commit to vawale/indicators that referenced this issue Jul 3, 2024
When the terminal width is too small, we run into problems as mentioned
in p-ranav#132. This PR fixes the
problem by keeping track of number of wrapped lines printed by progress
bar and erasing those extra wrapped lines before printing progress for
next iteration.

For multi_progress bar and dynamic_progress bar, we need to move cursor
to start before each iteration by summing up number of wrapped lines for
each bar. Since each bar's `print_progress` expects cursor to be on last
printed line, we move cursor down by number of wrapped lines before
printing progress for each bar.

I have not yet handled case when `dynamic_progress` option
`hide_bar_when_complete` is set.

Fixes Issue p-ranav#132
oresnir-hailo pushed a commit to oresnir-hailo/indicators that referenced this issue Nov 12, 2024
When the terminal width is too small, we run into problems as mentioned
in p-ranav#132. This PR fixes the
problem by keeping track of number of wrapped lines printed by progress
bar and erasing those extra wrapped lines before printing progress for
next iteration.

For multi_progress bar and dynamic_progress bar, we need to move cursor
to start before each iteration by summing up number of wrapped lines for
each bar. Since each bar's `print_progress` expects cursor to be on last
printed line, we move cursor down by number of wrapped lines before
printing progress for each bar.

I have not yet handled case when `dynamic_progress` option
`hide_bar_when_complete` is set.

Fixes Issue p-ranav#132

(cherry picked from commit b06a9c1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant