On 26/05/18 12:28, Ben Caradoc-Davies wrote:
On 26/05/18 00:21, Adam Borowski wrote:
It might be good to pipe output through ansi2txt
Thank you so much for alerting me to ansi2txt. Given the miserable
failure of some command line tool authors to contemplate terminal
background colours other than black, I have had to endure all manner of
workarounds. One investigation revealed ANSI sequences hardcoded in the
source with no way to turn them off. The horror.
In my view, colour output should not be the default. Anyone who causes
yellow or light green or, worst of all, white text to be displayed on a
white background should be dealt with by the a11y police.
Exhibit A: dpkg-buildpackage (attached). This was just the one in front
of me. There are many more. I should start a collection. I have "export
TERM=xterm-mono" in my ~/.bashrc.
Another offender is megatools, because who doesn't like progress bars
with hardcoded ANSI sequences for white and yellow foreground regardless
of background?:
https://github.com/megous/megatools/blob/master/lib/tools.c#L270
https://github.com/megous/megatools/blob/master/lib/tools.h#L60
What's a termcap?
An appropriate penalty for careless use of ANSI sequences would be for
offenders to be required to include this in their ~/.bashrc for two years:
echo -en "\e]10;black\x7\e]11;black\x7"
I think we need an EU Directive.
Kind regards,
--
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand