On 03/04/09 04:10, Taylor Venable wrote:
>
> I have an xterm compiled with 256 color support.  In Vim 7.2.88 after
> it loads up I can do :set t_Co to find that 256 color support is being
> found correctly (TERM = xterm-color).  However, I cannot figure out
> how to determine whether 256 colors are supported on startup, as the
> value of t_Co is 8 at the time my .vimrc is loaded.
>
> I've tried a few autocommands, such as VimEnter and TermChanged but
> the value of t_Co in both of them is still 8, rather than the 256 I
> expect.  At what point does t_Co get set to reflect the capabilities
> of the terminal, and how can I detect it during startup?
>
> Thanks,
>

Before sourcing your vimrc, Vim sets t_Co to the number of colors it 
"thinks" your terminal has, according to $TERM and the (usually 
built-in) termcap for that terminal. For an xterm-color this usually 
means 8, as you noticed. If you are somehow certain that your terminal 
supports more colors, you can set t_Co yourself.

At GUI startup, t_Co is set to the empty string from the builtin_gui 
termcap, as it doesn't govern the number of colors (usually 16777216) 
which can be used in the GUI.


Best regards,
Tony.
-- 
A new koan:

        If you have some ice cream, I will give it to you.

        If you have no ice cream, I will take it away from you.

It is an ice cream koan.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to