[PATCH 2/2] pacman: let the progress bar "C"/"c" move up and down at a more regular rate

Allan McRae allan at archlinux.org
Thu Jul 28 23:45:02 UTC 2022


On 23/7/22 06:27, Alexander F. Rødseth wrote:
> 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.
> 

How I would love to remove this option, but I think I would suffer a 
revolt from users!

This is fine.

> Signed-off-by: Alexander F. Rødseth <xyproto at archlinux.org>
> ---
>   src/pacman/callback.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/pacman/callback.c b/src/pacman/callback.c
> index df4032a4..aa6303bf 100644
> --- a/src/pacman/callback.c
> +++ b/src/pacman/callback.c
> @@ -165,7 +165,7 @@ static void fill_progress(const int percent, const int proglen)
>   				if(i > hashlen - hash) {
>   					putchar('-');
>   				} else if(i == hashlen - hash) {
> -					if(i % 2 == 0) {
> +					if(percent % 2 == 0) {
>   						fputs("\033[1;33mC\033[m", stdout);
>   					} else {
>   						fputs("\033[1;33mc\033[m", stdout);



More information about the pacman-dev mailing list