15

I had spent so much time to try to get urxvt to work with 256 colors. I am using Ubuntu. I have followed a part of this post

cd ~
infocmp -L rxvt-unicode > rxvt-unicode.terminfo

vi rxvt-unicode.terminfo
# Change the following from:
#
#    lines_of_memory#0, max_colors#88, max_pairs#256,
#
# to:
#
#    lines_of_memory#0, max_colors#256, max_pairs#32767

# Make .terminfo dir if you don't already have it
install -d .terminfo

# Rebuild terminfo for rxvt-unicode
tic -o .terminfo/ rxvt-unicode.terminfo

# Cleanup
rm rxvt-unicode.terminfo

tput colors gives 256 now instead of 88 earlier But when I run the 256colors2.pl script, the output is not as expected. Here is the screenshot

echo $TERM gives rxvt-unicode as output in urxvt.

echo $COLORTERM gives rxvt-xpm as output in vim.

echo &t_Co gives 256 as output in vim.

Please help me figure out how to set up 256 colors for urxvt. My main aim is to use vim(in terminal) with the gruvbox theme.

Response for an answer:

I have already set the t_Co=256 option in vim. I don't use tmux. Using it doesn't change the result of the 256colors2.pl script. The TERM in tmux is already set to screen-256color. I tried copying the /usr/share/terminfo/r/rxvt-256color to ~/.terminfo/r/rxvt-256color. No change on TERM or the results of the tests. Finally I used the colortest CJD14 has linked, many colors are not working. Only a bunch of colors are being coloured. So something is definitely broken or configured wrong.

18

Yes, finally found my mistake. It seems like you need to install the package rxvt-unicode-256color to get 256 color support.

sudo apt-get install rxvt-unicode-256color

is the answer to my problems.

  • 1
    In Debian rxvt-unicode-256color is a virtual package for rxvt-unicode which supports 256 colors. In spite of this being installed, I'm unable to get 256 color support in neovim even though urxvt has 256 color support. – Jon May 12 '18 at 6:09
0

Try copying /usr/share/terminfo/r/rxvt-256color to ~/.terminfo/r/rxvt-256color

And in your vimrc add

set t_Co=256 

Also add

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

In your tmux, screen conf if used.

Oh and check out CSApprox vim plugin when you get the full color support it makes many themes look great in terminals.

Also try this script in vim to verify full color support. colortest

  • 1
    Adding TERM=screen-256color to your .tmux.conf is a terrible idea. The correct way to do it is set -g default-terminal "screen-256color" – jasonwryan Apr 16 '15 at 6:04
  • I have already set the t_Co option. I don't use tmux. Using it doesn't change the result of the 256colors2.pl script. The TERM in tmux is already set to screen-256color. I tried copying the /usr/share/terminfo/r/rxvt-256color to ~/.terminfo/r/rxvt-256color. No change on TERM or the results of the tests. Finally I used the colortest you have linked, many colors are not working. Only a bunch of colors are being coloured. – ma08 Apr 16 '15 at 9:54

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.