How to change the color of this blue text on the command line

colorsputtyterminal

I know this question has been asked multiple times but I didn't find the answer on those other questions.

Here an Image to illustrate my point:

enter image description here

Can you read the blue line without squinting? No? Me neither.

I am running an ansible playbook in full verbose mode and need to read those logs with a playbook of 50+ tasks.

Can anyone explain how can I change those colors?

Questions I looked at where I didn't figure out a solution:

Best Answer

Nope, never have been able to read blue on black (and life is far too short to fiddle with colour customizations in every terminal or console combination I might use) so I disable colors by default. With xterm, an .Xdefaults entry of:

XTerm*colorMode:false

does wonders; otherwise, without a means to kill the colors in the terminal, application specific hacks may be necessary; a quick kluge is to use a shell function and pipe the output to cat which disconnects ansible from the terminal and may cause it to not spam colors:

function ansible-playbook {
    command ansible-playbook "$@" | cat
}

Another kluge is to fiddle with the TERM, e.g. TERM=vt220 ansible-playbook ... (this tends to work on older systems, but the color spam alas is present with TERM=vt220 on modern systems and changing the TERM without knowing what you're getting into is probably a bad idea).

However! From some spelunking under the ansible sources, ansible is not buggy and does provide an ANSIBLE_NOCOLOR=1 environment variable:

ANSIBLE_NOCOLOR=1 ansible-playbook ...
Related Question