You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Colorization relies on the en_US (or similar) locale. Neither date, nor file size are colorized e.g. with LC_TIME=de_CH.UTF-8.
System: Fedora 35, grc 1.13 and zsh 5.8.1 from the official repo.
Steps to reproduce
$ LC_TIME=de_CH.UTF-8
$ ls -l
Expected result
Colorized permissions, root, file size and date
Actual result
Only permissions are colorized
Problem analysis
The regular expression \s+(\d{7}|\d(?:[,.]?\d+)?[KM])(?=\s[A-Z][a-z]{2}\s) requires a three-letter string with a trailing whitespace. This breaks on so many levels: Most languages use letters outside of A through Z, including in these abbreviations (German "Mär", Russian мар, Greek Μαρ), some locales have longer short months (févr. in French, including the dot, which is another problem). When fixing this, one should also consider that a lot of locales use dots or other symbols after the day. Compare en_US Dec 29 2017 with de_CH 29. Dez 2017 and zh_CN 12月 29 2017. A solution should at least consider these cases, potentially more.
Radical solution
Fundamentally, what grc can offer over ls --color=tty is inferior, since grc cannot offer to distinguish directories from files. It adds very little and a good part of this is broken in most of the world. Additionally it breaks colorization and formatting in zsh (see #36 which has been open for almost 6 years). Therefore, I would opt to drop support for ls completely. Not because it is hard to fix all the bugs, but because I see almost no value in it even with all the bugs fixed.
Last nitpick
In human-readable mode, files with 1K <= size < 1M are green, without it, they are unchanged. No idea, what was intended, but one should either remove the K in the regular expression mentioned above, or match 4 to 7 digits to include smaller files without human-readable sizes.
The text was updated successfully, but these errors were encountered:
Colorization relies on the en_US (or similar) locale. Neither date, nor file size are colorized e.g. with
LC_TIME=de_CH.UTF-8
.System: Fedora 35, grc 1.13 and zsh 5.8.1 from the official repo.
Steps to reproduce
Expected result
Colorized permissions, root, file size and date
Actual result
Only permissions are colorized
Problem analysis
The regular expression
\s+(\d{7}|\d(?:[,.]?\d+)?[KM])(?=\s[A-Z][a-z]{2}\s)
requires a three-letter string with a trailing whitespace. This breaks on so many levels: Most languages use letters outside of A through Z, including in these abbreviations (German "Mär", Russian мар, Greek Μαρ), some locales have longer short months (févr. in French, including the dot, which is another problem). When fixing this, one should also consider that a lot of locales use dots or other symbols after the day. Compare en_USDec 29 2017
with de_CH29. Dez 2017
and zh_CN12月 29 2017
. A solution should at least consider these cases, potentially more.Radical solution
Fundamentally, what grc can offer over
ls --color=tty
is inferior, since grc cannot offer to distinguish directories from files. It adds very little and a good part of this is broken in most of the world. Additionally it breaks colorization and formatting in zsh (see #36 which has been open for almost 6 years). Therefore, I would opt to drop support forls
completely. Not because it is hard to fix all the bugs, but because I see almost no value in it even with all the bugs fixed.Last nitpick
In human-readable mode, files with 1K <= size < 1M are green, without it, they are unchanged. No idea, what was intended, but one should either remove the
K
in the regular expression mentioned above, or match 4 to 7 digits to include smaller files without human-readable sizes.The text was updated successfully, but these errors were encountered: