p-ranav / indicators

Activity Indicators for Modern C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fit progress bar to terminal width changes?

wkjarosz opened this issue · comments

Is there a way to have the progress bars react to terminal width changes so that each update does not spill onto the next line?

Thanks

I manually fixed this problem with a bar width ratio like 1/4 of terminal width.
Also I have long postfixes, and calculate the remaining length and concat string like:
std::string postfix_text_cut = postfix_text.substr(0, postfix_length + remaining);

Is not a general solution, so this is the reason for no PR, but maybe helped for some extra idea how to solve it.

Definitely is that issue very important for the smaller console windows.