views:

55

answers:

1

Hello folks.
(not sure if this question belongs here or to superuser)

I'd like to know if there is any way to determine a terminal's background color ?

In my case, using gnome-terminal.
It might matter, since it's entirety up to the terminal application to draw the background of its windows, which may even be something else than a plain color.

+1  A: 

Do you mean a method to ascertain the terminal background colour, or set the terminal colour?

If the latter you could query your terminal's PS1 environment variable to obtain the colour.

There's an article on setting (and so deriving) the terminal colours here: http://www.ibm.com/developerworks/linux/library/l-tip-prompt/

goose_wh
I mean to ascertain the background color. Not the color used to print characters (using escape codes), but the of window itself. Nice article however :)
Romuald Brunet