I've been battling it out with this 256-colour terminal malarkey and I just can't get decent colour displays in a terminal. I'm using ubuntu-server with openssh and zsh. I have tried accessing the machine from both Windows (Putty) and RHEL (gnome-terminal) and neither of them displays the colours properly.

I double checked that:

  • $TERM is set to xterm-256color
  • There is a file present in /lib/terminfo/x/xterm-256color

Whenever I use a vim or oh-my-zsh theme, the colours are all ANSI based. What am I missing?

EDIT: Oh I should also say that when i do

echo "$FG[214]Blah"

Then it displays using 256 colours. Neither the prompt nor vim displays the colours I expect.

  • Which terminal are you using on RHEL? zsh is only a shell, it doesn't have anything to do with colours. – grawity Jan 5 '12 at 16:15
  • Sorry, I edited the post to be more accurate – jabalsad Jan 5 '12 at 16:19
  • Besides setting TERM to xterm-256color various programs may require additional configuration to tell them to take advantage of the extended color palette. What terminfo file does the infocmp command say you’re using? – Chris Page Jan 5 '12 at 20:42
  • infocmp says 'colors#8'... – jabalsad Jan 5 '12 at 21:54
  • Was this ever figured out? – Kian Mar 15 '14 at 18:05

Try setting COLORTERM on the server.

In my case (ubuntu gnome-terminal to ubuntu server), adding this to ~/.bashrc solved it:

export COLORTERM=gnome-terminal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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