5

I've googled it for hours but I can't find a solution. I use raspian, on a raspberry pi and I want to have colorscheems work on it. Default terminal in raspian seems to be set at 8 colors as when I enter

tput colors

I get 8. I'm sure there must be a way to have the term work with 256 colors but I don't know how. Anyway I set tmux in the config file to support 256 colors, so I created a .tmux.conf file in my home directory and have

set -g default-terminal "screen-256color"

now if I check with tput within tmux I get 256. Anyway I know you can set VIM to force think you support 256 color by adding

set t_Co=256

but this seems to make no actual change. If I run this color test

:runtime syntax/colortest.vim

in normal terminal from raspian I get only 8 different colors. If I do this on tmux I get more but not all of them because some of them (red and lightred for example) still look the same.

5
  • Do you work on the pi directly or via SSH? If directly, do you use a desktop environment? If yes, what terminal emulator do you use? If not, you'll probably never get 256 colors. Also, you usually don't need to add set t_Co=256 to your ~/.vimrc if you have set -g default-terminal "screen-256color" in ~/.tmux.conf.
    – romainl
    Commented Mar 1, 2014 at 12:58
  • I have raspian installed on the raspberry pi, downloaded zsh and istalled it. Then have pi hdmi connected to my monitor and a keyboard to work on it. Also have installed x. That's it. No more stuff just really row raspian. I don't now what terminal I use....
    – UfoRobot
    Commented Mar 1, 2014 at 18:04
  • If I do it via ssh on my mac it works... Does rasp terminal not support colors at all? 'couse that would be the solution...
    – UfoRobot
    Commented Mar 1, 2014 at 18:35
  • Did you tried 'set term=xterm-256color' Commented Mar 10, 2014 at 11:38
  • Yes but no result... I think it is probably because I am not using any terminal emulator but the raw raspian terminal which probably doesn't support 256 colors... I tried to googled it but I didn't find a how many colors it supports.
    – UfoRobot
    Commented Mar 12, 2014 at 16:59

2 Answers 2

4

did you add set t_Co=256 after the line colorscheme <yourColourScheme>? That was a problem I had early on.

Let me know if you're still having trouble, because I managed to solve a similar problem (only I'm using MobaXterm and GNU screen), and wouldn't mind the excuse to dig into this a bit more.

0

I was having a similar problem and have solved it with the following setup. .zshrc on my OSX laptop contains:

TERM=xterm-256color

after I ssh into raspbian, tput colors returns 256. On raspbian, I don't have TERM explicitly set (which means it pulls it from ssh), and have the following in .tmux.conf:

set -g default-terminal "xterm-256color"

Then after I do tmux (and I don't even need the -2), tputs colors still reports 256 colors and vim looks right. I am using vanilla solarized with no edits in .vimrc or elsewhere in the vim configs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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