Package: grc
Version: 1.12-1

The grc package has suddenly added aliases to colourify several commands.
Worse, it creates some truly awful (e.g. white on green) and completely
useless and unreadable colour combinations (e.g. blue on black for several
commands, and black on black for docker container and image IDs).

I don't know exactly what version of the grc package started this (I only
noticed last night after rebooting my machines for a kernel upgrade), but this
should:

1. Be optional/configurable - e.g. with a "GRC_ALIASES=[true | false]" setting
in /etc/default/grc

IMO the default should be 'false' (for the principle of least surprise) but
that doesn't really matter as long as there is a way for the user to choose.

I have grc installed to colourise logs and other output when I want to. I wasn't
expecting to have common commands suddenly have garish and hard-to-read colours.

BTW, depending on order of execution, these aliases may also over-ride aliases
already set by the user/system-admin.


2. Not assume a white terminal background.  Either choose colours that work
on both white and black backgrounds, or have a "light" and a "dark" set of
colours.

A "light" and "dark" set could be implemented by having a /usr/share/grc/light
and /usr/share/grc/dark subdirectories (which should all be conffiles as
noted below).

The /etc/profile.d/grc.sh script could read a setting in /etc/default/grc
(e.g. GRC_ALIASES=[light|dark|none]), and symlink the appropriate colour set
into /usr/share/grc/ - e.g 

    if [ -n "$GRC_ALIASES" ] && [ "$GRC_ALIASES" != "none" ] ; then
        ln -sf "/usr/share/$GRC_ALIASES"/conf.* /usr/share/grc/
    fi

A setting of "none" should delete all symlinks in /usr/share/grc.  e.g.

    if [ -z "$GRC_ALIASES" ] || [ "$GRC_ALIASES" = "none" ] ; then
        find /usr/share/grc/ -maxdepth 1 -type l -delete
    fi


3. List /usr/share/grc/conf.* as conffiles.  None of them are currently
conffiles in the package - this means that any local customisations (like
fixing black on black) will be reset every time grc is upgraded.


craig

PS: I had to undo this on all my systems by running (in every terminal and
tmux window...dozens of shells after rebooting them for a new kernel and
re-starting my usual terminal windows and tmux sessions, so this was very
tedious):

    unalias as blkid colourify configure df diff dig docker docker-compose 
docker-machine du env fdisk findmnt free g++ gas gcc getsebool head id ifconfig 
ip iptables journalctl kubectl ld lsblk lsof lspci make mount netstat ping ps 
semanage sockstat ss tail traceroute traceroute6

I also had to edit /etc/profile.d/grc.sh on all machines to prevent it from
happening again:

- if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
+ if [ 0 -eq 1 ] ; then

Reply via email to