10

That's what I have in my .bashrc

if [ -n "$DISPLAY" -a "$TERM" == "xterm" ]; then
    export TERM=xterm-256color
fi

In my .vimrc I have:

set t_Co=256

echo $TERM prints xterm-256color

tput colors prints 256

I've also runned a script called 256colors2.pl and all colors are printed correctly. Still what I see in my terminal is this (that's the "desert" theme):

desert

Also the colortest.vim file does not display properly:

colortest

Apparently it only shows the default color palette of my terminal.

  • Just to confirm, what does the output of ":verbose set term?" (with the question mark as part of the command) say? – Heptite May 4 '14 at 19:20
  • "term=xterm-256color". I don't know what happens. Is xfce terminal overriding the colours? – Sleeper May 4 '14 at 22:07
  • It shouldn't be. – Heptite May 4 '14 at 23:30
  • So do you know how to change it? – Sleeper May 4 '14 at 23:41
  • Unfortunately I don't know what's wrong, so I don't. It shouldn't make any difference, but what happens if you do :set term=xterm-color in Vim? – Heptite May 5 '14 at 1:56
1

You need to go to the xfce terminal preferences, click the Compatibility tab, and make sure the emulation setting is "xterm-256color" and not "xterm"

The basic reason for the issue can be found in this article: https://codeyarns.com/2015/03/18/how-to-set-term-to-xterm-256color/

Basically, you need to have VTE or GNOME based terminals set the term environment variable before the shell is invoked. The above settings will cause this to happen in the XFCE terminal

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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