On Mon, 27 Mar 2023 Greg Wooledge wrote:
On Mon, Mar 27, 2023 at 08:52:10AM -0400, Dan Ritter wrote:
Greg Wooledge wrote:
3) apt uses a horrible yellow color that is nigh-unreadable on a white
background. (This is not configurable.)
I use exclusively apt-hyphenated commands (apt-{get,cache,etc}), and
don't plan to change.
I have
$ cat /etc/apt/apt.conf.d/90no_color
APT::Color "false";
So I am surprised to learn that the newfangled bare "apt" ignores that
preference. Not a pleasant surprise.
Like I said though, I don't plan to start using it.
It appears that it is, just badly documented.
In /etc/apt/apt.conf, you can specify the escape sequences for
colors like this:
APT::Color::Yellow "ESC[33m";
This seems less general a solution than warranted. If the user can't
see yellow, they don't only want *apt* to use an alternate color for
yellow.
I would instead want to tweak the whole console color scheme along
these lines,
https://nethackwiki.com/wiki/Colors#Linux_console
so that the colors were more sensible across all applications.
unicorn:~$ man apt.conf | grep -i -e color -e colour
unicorn:~$ man apt-config | grep -i -e color -e colour
unicorn:~$
Yeah, that's "badly documented" i.e. "not documented at all".
Here are some other things one might find by poking around the web or
various commands:
apt-config(8)
dump
Just show the contents of the configuration space.
unicorn:~$ apt-config dump | grep -i -e color -e colour
Binary::apt::APT::Color "1";
So, there's a quasi-visible configuration element that lets you turn off
apt's use of colors completely. Undocumented, obviously.
Doesn't work for me.
# apt -o "Binary::apt::APT::Color=0" update
"N% [Working]" etc output is still colorised.
Your APT::Color::Yellow is not even visible in the dump of all the
configuration elements.
<https://salsa.debian.org/apt-team/apt/-/blob/main/doc/examples/configure-index>
contains:
apt::moo::color "<BOOL>";
apt::color::highlight "<STRING>";
apt::color::neutral "<STRING>";
APT::Color "<BOOL>";
I have no idea how out of date or inaccurate these may be.
It's also incredibly difficult to TEST any changes to apt's color
configuration, because the parts I care about are circumstantial.
The yellow color is used on the progress/status line while apt
is downloading stuff -- and if you've already run "apt update" earlier
today, chances are there won't be any new data to download when you run
it a second time.
If I use "apt search google-chrome-stable" I get the following text:
unicorn:~$ apt search google-chrome-stable
Sorting... Done
Full Text Search... Done
google-chrome-stable/stable,now 111.0.5563.110-1 amd64 [installed]
The web browser from Google
where the package name (google-chrome-stable) appears green. So...
can I test using that? It appears I cannot.
If I put Binary::apt::APT::Color "0"; in my /etc/apt/apt.conf.d/99local
file, and re-run the apt search command, it's still green.
[rest trimmed]
Would you like blinking text instead? (Or whatever your terminal does
instead of blinking text.)
# apt -o "APT::Color::Highlight=^[[5m" search nethack
^^
(raw escape)
(entered with Ctrl-V followed by hitting Esc key)
(explained for benefit of readers as clueless as myself)
I got the blinking text thing from console_codes(4), under section
"ECMA-48 Set Graphics Rendition".
According to that same section, replacing "5" with "25" sets "blink
off"
# apt -o "APT::Color::Highlight=^[[25m" search nethack
For me, this produces text in the default style (no highlights, no
colors).
--
Believe you do in the church, not infront of the computer, when we see
the output we can conclude ourself. -- deloptes