New fancy progress bars writing new lines instead of updating original

  • Open
  • quality assurance status badge
Details
3 participants
  • chris
  • elaexuotee
  • Julien Lepiller
Owner
unassigned
Submitted by
elaexuotee
Severity
normal
E
E
elaexuotee wrote on 26 Aug 2023 03:25
(address . bug-guix@gnu.org)
25BZCYIUWNSCX.256OI9J50FFCZ@wilsonb.com
The new pretty progress bars are quite nice. One issue I am ecountering,
however, is demonstrated in the snippet below:

???????????????????? 71% ??????????????????????????????????????????????????????????????????????????????????????????????
???????????????????? 74% ???????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????? 77% ???????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????? 81% ???????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????? 84% ???????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????? 87% ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????? 90% ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????

When preceeding text contains double-width characters, progress bar updates end
up printing new lines instead of overwriting the original. When the preceeding
text is ascii, such as for substitute downloads, then the bars work
beautifully.

My guess is that the width-calculation simply forgets to account for possible
double-width charaters in the text snippet.

Anyone else seeing this?

Cheers,
B. Wilson
J
J
Julien Lepiller wrote on 26 Aug 2023 09:06
(address . 65541@debbugs.gnu.org)(address . elaexuotee@wilsonb.com)
20230826090627.7a3ca507@lepiller.eu
Le Sat, 26 Aug 2023 10:25:53 +0900,
elaexuotee--- via Bug reports for GNU Guix <bug-guix@gnu.org> a écrit :

Toggle quote (32 lines)
> The new pretty progress bars are quite nice. One issue I am
> ecountering, however, is demonstrated in the snippet below:
>
> ???????????????????? 71%
> ??????????????????????????????????????????????????????????????????????????????????????????????
> ???????????????????? 74%
> ???????????????????????????????????????????????????????????????????????????????????????????????????
> ???????????????????? 77%
> ???????????????????????????????????????????????????????????????????????????????????????????????????????
> ???????????????????? 81%
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????
> ???????????????????? 84%
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????????
> ???????????????????? 87%
> ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????
> ???????????????????? 90%
> ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????
>
> When preceeding text contains double-width characters, progress bar
> updates end up printing new lines instead of overwriting the
> original. When the preceeding text is ascii, such as for substitute
> downloads, then the bars work beautifully.
>
> My guess is that the width-calculation simply forgets to account for
> possible double-width charaters in the text snippet.
>
> Anyone else seeing this?
>
> Cheers,
> B. Wilson
>

I don't think it's specific to the fancy bars, and I was able to
reproduce with "LANG=ja_JP.UTF-8 guix pull".

I sent a patch, now tracked https://issues.guix.gnu.org/65546,which
fixes the issue.

To test it, I did:

msgfmt po/guix/ja.po
cd ../..
mkdir -p ja/LC_MESSAGES
mv messages.mo ja/LC_MESSAGES/guix.mo
./configure --localstatedir=/var --sysconfdir=/etc --localedir=$(pwd)
make
./pre-inst-env guix pull

(if you don't specify a localedir, it'll try to find the translations
in /usr by default)

No more newlines :)
C
C
chris wrote on 1 Sep 2023 18:45
want this patch
(address . 65541@debbugs.gnu.org)(address . chris@bumblehead.com)
ZPIVH1gnZ9z4VLj4@guix-xps
As a CJK user hoping Julien's patch is accepted soon, this message is my "+1".
?