Monday, September 19, 2011

Re: ctermbg different depending on terminal

On Mon, 18 Sep 2011, Nathan Neff wrote:

> Hello,
>
> I have two terminals that I use -- xterm and urxvt.
>
> If I open up vim in urxvt, the "Visual" highlighting is this:
> Visual         xxx term=reverse ctermbg=7 guibg=LightGrey
>
> If I open up vim in xterm, the "Visual" highlighting is this:
> Visual         xxx term=reverse cterm=reverse guibg=LightGrey
>
> If I open up vim in Terminator, it's the same as in Xterm
>
> Where does the ctermbg=7 come from when I'm in urxvt?

I get ctermbg=7 whenever the environment indicates that it's a
256-color-capable terminal emulator. This includes recent rxvt-unicode
(urxvt), which has the default TERM=rxvt-unicode-256color. But, also
using XTerm with TERM=xterm-256color. Or when using Vim's termcap
option 't_Co', e.g.:

xterm -e vim --cmd 'se t_Co=256'
(or in .vimrc: se t_Co=256)

Vim tries to keep colors more visually distinct when it has a larger
palette to work with. Using --cmd 'se t_Co=8' under urxvt, I get the
xterm behavior.

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment