Thursday, December 31, 2015

When is an xterm's t_Co detected?

I recently learned that Vim can query an xterm directly for the
number of colors it supports. (This is not necessarily the same
value reported by terminfo. Otherwise, it wouldn't be very useful.)
Vim then sets t_Co to this number. I would like to use that value
to affect other color settings, but I can't figure out when to do
that. I captured the value of &t_Co at the start and end of my
~/.vimrc and upon these autocommand events,

BufWinEnter
ColorScheme
FileType
OptionSet
TermResponse
VimEnter

but the value was always 8. By the time I queried the value from
Vim's command line, though, the value was 256.

What event do I need to wait for to determine that t_Co may have
changed to 256?

Regards,
Gary

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment