I hate that blue background which is everywhere in ncurses applications like: irssi, mc, tig, … I want to change that color, how can I do it?
I know that midnight commander has themes, but what about global settings for all CLI programs? I found that there's setterm
in Linux and vidcontrol
in FreeBSD, but vidcontrol
doesn't work for me, and I think it's not that what I need because it's for VESA stuff. I'm working over ssh here.
Best Answer
Some terminals like xterm allow to redefine the colors via resource files or dynamically, and if it's exposed correctly in the terminfo entry for $TERM, you can do it with:
Change ANSI color 4 (normally blue) to RGB (1000, 0 0), that is bright red.
If the terminal doesn't support redefining colours (see
infocmp -1 | grep initc
), you can also, for applications that use terminfo, trick them into sending different escape sequences to request colour 4 (blue).Edit
terminal.info
, replace the name of the terminal with something like "myterm", and edit the "setab" property (set ANSI background).Instead of
That is:
sends ^[[44m, change it to:
The
%? ....
, is an if-then-else, to say send "1" when asked for "4" and the requested one otherwise.So
will send
^[[41m
, (red) andtput setab 5
will send^[[45m
Then, compile it with:
and use it as:
That only works if the application uses the terminfo database to send sequences to the terminal.