Thursday, October 1, 2020

Re: `set t_Co=16` in vimrc file has no effect

On 2020-10-01, Christian Brabandt wrote:
> On Mi, 30 Sep 2020, Bram Moolenaar wrote:
>
> > > As I recall, VimEnter is too early.
>
> Would a timer work?

Perhaps. And it might be better than nothing. But timers carry the
risk that you wait too long on fast systems/connections and not long
enough on slow systems/connections.

> > > I often work remotely, with a terminal on my desktop at home or in
> > > an office and the host on which Vim is running many miles away,
> > > often through a relatively slow network. For a while, after either
> > > my xterm changed or Vim changed so that t_Co was reset after
> > > receiving the termresponse, my vim screen would flash at startup
> > > because it would first be drawn using t_Co=16 as set in my vimrc,
> > > then be redrawn a moment later at t_Co=256 when the termresponse was
> > > received.
> >
> > That's why I was thinking of disabling the mechanism, to avoid the
> > flicker. Of course you then need to manually set the value.
>
> Do you mean, if the option is set manually in vimrc, disable the
> termresponse? That would be a good compromise, I think.

The problem is, in my case, that I use a variety of terminals
running in a variety of operating systems to access vim on a variety
of hosts. Sometimes I run vim locally while at other times I run it
over an ssh connection. TERM is unreliable--almost every terminal
claims it's an xterm. The termresponse has been for me an excellent
means of determining the terminal type. It's just a little slow.
Disabling it would leave me as if back in pre-termresponse days with
terminal-dependent settings that weren't optimum and colors that
were often unreadable.

What I would like to be able to do--although I haven't tried this so
I might not like it after all--is to send t_RV at the start of my
vimrc, wait for the response (with a timeout), let Vim do what it
normally does upon receiving a termresponse, then continue with
the processing of the rest of my vimrc. The termresponse exchange
normally happens in a fraction of a second, before I can type my
first keystroke anyway, and in less time than it takes to start Vim
on Windows, and the delay would prevent the flickering of a second
display refresh.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20201001080636.GD31849%40phoenix.

No comments:

Post a Comment