Gentoo Archives: gentoo-dev

From: William Hubbs <williamh@g.o>
To: gentoo-dev@l.g.o
Cc: ulm@g.o
Subject: Re: [gentoo-dev] Output of ANSI escape sequences in ebuilds
Date: Wed, 18 Dec 2019 15:24:56
Message-Id: 20191218152447.GA25058@linux1.home
In Reply to: [gentoo-dev] Output of ANSI escape sequences in ebuilds by Ulrich Mueller
1 On Sat, Dec 14, 2019 at 08:16:03AM +0100, Ulrich Mueller wrote:
2 > Some ebuilds output SGR control sequences (formerly known as ANSI escape
3 > sequences) to the terminal, i.e., they do things like:
4 >
5 > echo -e "\033[1m${@}\033[0m"
6 > einfo "Fetching \e[1m${r}\e[22m ..."
7 > ewarn "\033[1;33m**************************************************\033[00m"
8 > echo -ne "\a" # (not actually an ANSI escape sequence)
9 >
10 > These prevent NOCOLOR in make.conf or emerge --color=n from working
11 > correctly, and I guess they are also problematic from an accessibility
12 > point of view.
13 >
14 > Are there any objections against removing these sequences from strings?
15 > AFAICS, they are used by less than ten packages, and one eclass.
16
17 I just found another place that uses them very heavily. I don't know if
18 it is part of cargo.eclass, or if it is a bug in /usr/bin/ebuild, but
19 I'm working on an ebuild and found that if I run:
20
21 $ ebuild foobar.ebuild compile >& output
22
23 that output file is full of ansi sequences even though I have
24 NOCOLOR=yes in make.conf.
25
26 Thanks,
27
28 William

Attachments

File name MIME type
signature.asc application/pgp-signature