Why do I see only 8 colors in the terminal (xfce-terminal)?

I am running Xubuntu 13.04 and I want to use Vim as my default editor for everything. I downloaded many vim color schemes and tried them, but they all do not look like the official screenshot.

For example, vim has its own color scheme - the desert should look like this:

enter image description here

But in my vim, many colors will not be displayed, for example, the background.

enter image description here

So that means fighting the xfce terminal, and I can't get it to use 256 colors. tput command colors give me 8.

At the same time, the code for ((x = 0; x <= 255; x ++)); do echo -e "$ {x}: \ 033 [48; 5; $ {x} mcolor \ 033 [000m", this shows me nice colors. I think I missed something. If I run

**$ echo $TERM** 

I get xterm. It should be "xterm-256color"

When I try to set term = xterm-256color as well as export TERM = xterm-256color

Then: echo $ TERM

I get an Xterm-256-color message.

But after registering / registering, I still do not get the correct colors in Vim. And I see that Xterm is changed to xterm again.

I added:

 if $TERM == "xterm-256color" set t_Co=256 endif 

and

t_Co = 256

into my .vimrc file and it didn't seem to help. Then I set up xterm entries; Added this to ~ / .Xdefaults:

  *customization: -color XTerm*termName: xterm-256color Add this to ~/.xsession to apply to new terminals: if [ -f $HOME/.Xdefaults ]; then xrdb -merge $HOME/.Xdefaults fi 

When I changed the terminal settings, the terminal environment emulation, "xterm" - "xterm-256color"

I get a message:

  '*** VTE ***: Failed to load terminal capabilities from '/etc/termcap' 

When I check / usr / share / vte / termcap / xterm, the xterm-256color file is missing. Same thing in the xterm0.0 folder. I tried to find this file on the Internet to download and install in a folder, but I could not find it.

It drives me crazy all day ... Does anyone have any suggestions?

+8
terminal xterm terminal-emulator x11 xubuntu
source share
1 answer

Fast (temporary) way

Enter this every time you open a new terminal:

 export TERM=xterm-256color 

Works as long as the window is open.

A working but dirty way

Add the line above to ~/.bashrc .

The problem with this is that editing $TERM in .bashrc is a bad idea, because any terminal using bash will automatically use it regardless of whether it supports 256 colors or not (for example, with an SSH connection or access to terminals from Ctrl + Alt + F1 to F6 ).

I did that because xfce4-terminal sets the value of $COLORTERM to xfce4-terminal , instead I added the following to .bashrc :

 if [ "$COLORTERM" == "xfce4-terminal" ] ; then export TERM=xterm-256color fi 

Thus, the relevant editing of $TERM occurs only if you use xfce4-terminal , which simply sets it to xterm anyway (and changing the emulation environment leads to a "VTE" message).

Literature:

+12
source share

All Articles