Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 924627 - sys-apps/less-643-r1: Hard to read blue color on black background and gnome-terminal
Summary: sys-apps/less-643-r1: Hard to read blue color on black background and gnome-t...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL: https://github.com/pygments/pygments/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-15 10:53 UTC by Pacho Ramos
Modified: 2024-09-22 19:12 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
screenshot.png (304439461-24c6b0ab-3c96-413a-ab38-98c7e2126fb3.png,213.05 KB, image/png)
2024-02-15 10:53 UTC, Pacho Ramos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2024-02-15 10:53:49 UTC
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
Comment 1 Bill Binder 2024-02-27 19:35:27 UTC
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)
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-27 19:37:43 UTC
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

```
Comment 3 Pacho Ramos gentoo-dev 2024-03-03 19:33:32 UTC
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 :/
Comment 4 Nick Bowler 2024-03-25 17:33:20 UTC
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/
Comment 5 Pacho Ramos gentoo-dev 2024-06-16 09:09:38 UTC
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
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-16 09:41:00 UTC
dilfridge is going to update the default.
Comment 7 Larry the Git Cow gentoo-dev 2024-06-30 19:35:59 UTC
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(-)
Comment 8 Pacho Ramos gentoo-dev 2024-07-05 17:57:58 UTC
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 :/