Tony Mechelynck wrote:
> 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.
Unfortunately the TermResponse event comes earlier. This is actually
what triggers Vim to ask for the termcap entries. It needs the xterm
version number to know if it might work.
--
LAUNCELOT leaps into SHOT with a mighty cry and runs the GUARD through and
hacks him to the floor. Blood. Swashbuckling music (perhaps).
LAUNCELOT races through into the castle screaming.
SECOND SENTRY: Hey!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---