Created attachment 885013 [details] screenshot.png Hello, I find really hard to read some files due to less using a dark blue color for variables. I can reproduce it when gnome-terminal (3.50.1) is configured with a black background. I have tried to change the color palette, but it doesn't seem to affect less colors at all. I attach a screenshot showing the issue. On the other hand, colors used in text console are much more readable, but I don't know how to get them used when using gnome-terminal. I have also tried to remove pygments package (as it seems to be used by lesspipe when available), but still the same output :/ $ echo $LESSOPEN |lesspipe %s Thanks a lot for your help
The previous version, sys-apps/less-633, does not have this problem as it actually obeys the configuration: $ lesspipe --help | grep LESSCOLOR LESSCOLOR env - toggle colorizing of output (no/yes/always; default: no)
lesspipe-r3.sh has: ``` # Allow people to flip color off if they dont want it case ${LESSCOLOR} in always) LESSCOLOR=2;; [yY][eE][sS]|[yY]|1|true) LESSCOLOR=1;; [nN][oO]|[nN]|0|false) LESSCOLOR=0;; *) LESSCOLOR=1;; esac if [[ ${LESSCOLOR} != "0" ]] && [[ -n ${LESSCOLORIZER=pygmentize} ]] ; then # 2: Only colorize if user forces it ... # 1: ... or we know less will handle raw codes -- this will # not detect -seiRM, so set LESSCOLORIZER yourself if [[ ${LESSCOLOR} == "2" ]] || [[ " ${LESS} " == *" -"[rR]" "* ]] ; then LESSQUIET=true ${LESSCOLORIZER} "$1" fi fi ```
The problem to me is not the colorizing or not... it is that the palette used is nearly impossible to read in gnome-terminal. On the other hand, the one used in the text console is nice... but I don't know how to use that palette... neither how can I modify it :/
Explicitly setting LESSCOLOR=no works to get rid of this rainbow vomit, so the default is clearly not "no" despite the fact that lesspipe --help says the default is no. It would be nice if it respected NO_COLOR=1 (quite a lot of programs do) http://no-color.org/
It seems it's caused by default pygments palette. https://github.com/pygments/pygments/issues/2693 For me, "igor" one looks to be a good compromise for black and white backgrounds
dilfridge is going to update the default.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b76030b38cd62f190cfda1203192af26ce7fb4f commit 3b76030b38cd62f190cfda1203192af26ce7fb4f Author: Sam James <sam@gentoo.org> AuthorDate: 2024-06-30 19:33:08 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-06-30 19:34:17 +0000 sys-apps/less: add 661, lesspipe fixes * Add 661 * lesspipe: respect NO_COLOR * lesspipe: fix documentation for colour default * lesspipe: choose a better colour theme ('rrt'). Another considered option was 'igor'. Closes: https://bugs.gentoo.org/924627 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/less/Manifest | 1 + sys-apps/less/files/lesspipe-r4.sh | 342 +++++++++++++++++++++++++++++++++++++ sys-apps/less/less-661.ebuild | 96 +++++++++++ sys-apps/less/less-9999.ebuild | 6 +- 4 files changed, 442 insertions(+), 3 deletions(-)
Thanks a lot! Sadly, while 'rrt' looks nice with a black background, I have tried to change the background to white in gnome-terminal and I think that it is a bit hard to read :/