pacman: let the progress bar "C"/"c" move up and down at a more regular rate
For some terminal widths, the "C"/"c" character does not alternate at regular intervals, but may look like it is stuck at either lowercase or uppercase. The previous behavior toggled based on the character position, while this new behavior toggles the chomp alternation based on the progress percentage value. This leads to slightly improved chomping. Signed-off-by: Alexander F. Rødseth <xyproto@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
5abe1455f2
commit
51b2e1c973
1 changed files with 1 additions and 1 deletions
|
@ -165,7 +165,7 @@ static void fill_progress(const int percent, const int proglen)
|
||||||
if(i > hashlen - hash) {
|
if(i > hashlen - hash) {
|
||||||
putchar('-');
|
putchar('-');
|
||||||
} else if(i == hashlen - hash) {
|
} else if(i == hashlen - hash) {
|
||||||
if(i % 2 == 0) {
|
if(percent % 2 == 0) {
|
||||||
fputs("\033[1;33mC\033[m", stdout);
|
fputs("\033[1;33mC\033[m", stdout);
|
||||||
} else {
|
} else {
|
||||||
fputs("\033[1;33mc\033[m", stdout);
|
fputs("\033[1;33mc\033[m", stdout);
|
||||||
|
|
Loading…
Add table
Reference in a new issue