Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

migrated from serverfault.com Aug 26 '12 at 8:02

This question came from our site for professional system and network administrators.

    
What SSH client? –  Tim Brigham Aug 3 '12 at 20:56
    
Nothing ssh client (lol what did you asked?) –  holms Aug 3 '12 at 21:36
5  
The color used is usually built into the application and has nothing to do with the shell. –  Zoredache Aug 3 '12 at 22:07
    
@holms you said you're working over ssh. I know putty lets you redefine the colors. If you're working in an OSX terminal, there's probably some way to do it (since that's what the OSX terminal themes do). –  DerfK Aug 4 '12 at 1:30
    
ok I just overrided color in iterm2 application. –  holms Aug 13 '12 at 10:12

2 Answers 2

up vote 3 down vote accepted

if you switch your TERM variable to a terminal that does not support ANSI colors, you will not see any blue background anymore.

share|improve this 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:

tput initc 4 1000 0 0

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).

infocmp > terminal.info

Edit terminal.info, replace the name of the terminal with something like "myterm", and edit the "setab" property (set ANSI background).

Instead of

setab=\E[4%p1%dm

That is:

tput setab 4

sends ^[[44m, change it to:

setab=\E[4%?%p1%{4}%=%t1%e%p1%d%;m

The %? ...., is an if-then-else, to say send "1" when asked for "4" and the requested one otherwise.

So

tput setab 4

will send ^[[41m, (red) and tput setab 5 will send ^[[45m

Then, compile it with:

TERMINFO=$HOME/.terminfo tic terminal.info

and use it as:

TERMINFO=$HOME/.terminfo TERM=myterm the-application-to-trick

That only works if the application uses the terminfo database to send sequences to the terminal.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.