Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1102746

Bug#1010806: apt: Avoid color output on monochrome terminals

From Axel Scheepers <axel.scheepers76@gmail.com>
Newsgroups linux.debian.bugs.dist
Subject Bug#1010806: apt: Avoid color output on monochrome terminals
Date 2022-05-10 21:50 +0200
Message-ID <ElE1P-eBDs-15@gated-at.bofh.it> (permalink)
References <ElxWq-eycc-5@gated-at.bofh.it> <Elzvb-eyYm-3@gated-at.bofh.it> <ElAAV-ezOV-1@gated-at.bofh.it> <ElxWq-eycc-5@gated-at.bofh.it> <ElAAV-ezOV-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

Thanks for your quick response and thoughtful comments,

On Tue, May 10, 2022 at 6:04 PM Julian Andres Klode <jak@debian.org> wrote:
> On Tue, May 10, 2022 at 04:54:21PM +0200, Adam Borowski wrote:
> > You mean monochrome terminals such as "xterm", "rxvt", "linux", ...?

Yes, and screenreaders or other accessibility tools. A linux/unix terminal can
be a great interface for people with visibility problems.

> > I haven't seen an actual monochrome terminal since the first half of the
> > 90's.  But even those accepted color codes and gracefully ignored them.
> > To find a terminal that speaks a different language you'd need to go
> > another decade into the past.

My first crt one was a vt-52 compatible :)
There are other uses however like the mentioned accessibility tools. It's the
same reason some people like/have to use the ed editor or the edbrowse(r).

> > Thus, I guess that what you want is some global switch to disable color
> > in programs.  But there's no common characteristic of a terminal that'd
> > allow autodetecting your wishes.
>
> apt respects https://no-color.org/ NO_COLOR environment variable,
> and I believe this is the way to go for this.

Oh that's really nice. I've requested this via other channels so I'm glad
it is implemented now. Thanks!

> For completeness, my bashrc does the following, so it looks at
> tput setaf 1 (change color to red to see if there's color available).
>
> case "$TERM" in
>     xterm-color|*-256color) color_prompt=yes;;
> esac

I'm referring to:

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color|*-256color) color_prompt=yes;;
esac

from /etc/skel/.bashrc (which imho also should avoid using color at all :).
The part you refer to is for forcing color output.

Thanks again for checking for NO_COLOR, I hope this can be used for
more things in the future.

Kind regards,
Axel

Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Bug#1010806: apt: Avoid color output on monochrome terminals Axel <axel.scheepers76+debian@gmail.com> - 2022-05-10 15:20 +0200
  Bug#1010806: apt: Avoid color output on monochrome terminals Daniel Abrecht <debian-apt@danielabrecht.ch> - 2022-05-10 16:50 +0200
  Bug#1010806: apt: Avoid color output on monochrome terminals Adam Borowski <kilobyte@angband.pl> - 2022-05-10 17:00 +0200
    Bug#1010806: apt: Avoid color output on monochrome terminals Julian Andres Klode <jak@debian.org> - 2022-05-10 18:10 +0200
      Bug#1010806: apt: Avoid color output on monochrome terminals Axel Scheepers <axel.scheepers76@gmail.com> - 2022-05-10 21:00 +0200
        Bug#1010806: apt: Avoid color output on monochrome terminals Adam Borowski <kilobyte@angband.pl> - 2022-05-16 18:40 +0200
          Bug#1010806: apt: Avoid color output on monochrome terminals Axel Scheepers <axel.scheepers76@gmail.com> - 2022-05-16 20:20 +0200
            Bug#1010806: apt: Avoid color output on monochrome terminals Adam Borowski <kilobyte@angband.pl> - 2022-05-25 21:40 +0200
              Bug#1010806: apt: Avoid color output on monochrome terminals Axel Scheepers <axel.scheepers76@gmail.com> - 2022-05-26 11:10 +0200
          Bug#1010806: apt: Avoid color output on monochrome terminals Daniel Abrecht <debian-apt@danielabrecht.ch> - 2022-05-16 23:10 +0200
      Bug#1010806: apt: Avoid color output on monochrome terminals Axel Scheepers <axel.scheepers76@gmail.com> - 2022-05-10 21:50 +0200

csiph-web