0

My problem:

I want to run ncurses in 256-colors mode in the gnome terminal.

I already know that you can turn on this color mode with:

# export TERM=xterm-256color

But this solution is not permanent. When ever a new Gnome terminal is opened, it returns to 8 color support again.

So how can I export TERM, such that this solution above becomes permanent?

1 Answer 1

0

Add the command you wish to be applied to every terminal to your .bashrc file, in your home directory:

echo 'if [[ $TERM == @(xterm|screen) ]]; then
    export TERM=$TERM-256color;
fi' >> ~/.bashrc

And it will be run every time you open a new shell.

1
  • 1
    Edited to check the old $TERM value; it is outright wrong to force xterm-256color if the old value is something like screen or linux. Jul 23, 2014 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .