On 09/04/09 04:33, Taylor Venable wrote:
> On Sun, Apr 05, 2009 at 02:34:26PM +0200, Bram Moolenaar wrote:
[...]
>> It's magic! :-)
>>
>> What happens is that on startup Vim determines the terminal settings
>> from the termcap/terminfo and builtin defaults. These may differ from
>> what the terminal actually uses, so for xterm we have built in a
>> mechanism to ask the xterm the actual values. This happens after
>> startup, Vim sends a few escape sequences to xterm and it responds with
>> a few specific escape sequences. The number of colors supported is one
>> of the values. This takes a little time, thus it's done asynchronously.
>>
>> You may also see that the intro screen disappears. This happens when
>> the value of the t_Co option changes, Vim needs to redraw the screen
>> then to get the colors right.
>>
>> I haven't tried it, but I think you can use the ColorScheme autocommand
>> event to handle the change, since when t_Co changes the color scheme is
>> reloaded.
>
> Thanks for the response. That's interesting how that works, and
> ultimately good for my case where the termcap database seems to
> indicate that the terminal supports less colors than it really does.
> I tried the ColorScheme autocommand but unfortunately it doesn't get
> triggered in this instance.
>
The TermResponse event is (IIUC), but I don't know if it's before or
after setting termcaps on the basis of v:termresponse (which is already
set by the time the autocommand is triggered). If you can discriminate
between 8-color and many-color terminals on the basis of the terminaal
response, then that's when you can do it.
Best regards,
Tony.
--
If an S and an I and an O and a U
With an X at the end spell Su;
And an E and a Y and an E spell I,
Pray what is a speller to do?
Then, if also an S and an I and a G
And an HED spell side,
There's nothing much left for a speller to do
But to go commit siouxeyesighed.
-- Charles Follen Adams, "An Orthographic Lament"
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---