Loading ...
Sorry, an error occurred while loading the content.

60am: where to put 'set t_Co=' ?

Expand Messages
  • Zdenek Sekera
    I have a special problem: I am using Xfree86 xterm(157) with SGI termlib which *does not* support colors, but for some reason I get beautiful colors (!!! yes I
    Message 1 of 2 , Jul 2 1:42 AM
    • 0 Attachment
      I have a special problem: I am using Xfree86 xterm(157)
      with SGI termlib which *does not* support colors, but for
      some reason I get beautiful colors (!!! yes I do!) when
      I make sure 'set t_Co=', that is t_Co is *blank*.

      Problem: where do I put 'set t_Co='?

      I tried all things I could think of, I ended up in having
      it as the last line of .vimrc, but it still doesn't work
      every time. Sometimes it works, other times I get ugly
      colors and when I check t_Co, it is set to 88 (which is
      number of colors I specified for xterm install).

      So vim has to interrogate xterm about setting of t_Co
      at some point and override my setting. OK, but why it
      doesn't happy every time?Does viminfo get into the play
      somehow? (I didn't find any indication of it).

      Currently when I get ugly colors, I have to type manually
      ':set t_Co=', I'd like to automate that and have vim come up
      with *my* t_Co every time. Where should I put that 'set command?

      (this is until I solve the ugly color problem).

      ---Zdenek
    • Bram Moolenaar
      ... That s strange. Since you mention further on that t_Co is set to 88, you probably compiled xterm with the --enable-tcap-query feature. In that case, you
      Message 2 of 2 , Jul 2 3:03 AM
      • 0 Attachment
        Zdenek Sekera wrote:

        > I have a special problem: I am using Xfree86 xterm(157)
        > with SGI termlib which *does not* support colors, but for
        > some reason I get beautiful colors (!!! yes I do!) when
        > I make sure 'set t_Co=', that is t_Co is *blank*.

        That's strange. Since you mention further on that t_Co is set to 88, you
        probably compiled xterm with the --enable-tcap-query feature. In that case,
        you shouldn't have to set t_Co at all.

        > I tried all things I could think of, I ended up in having
        > it as the last line of .vimrc, but it still doesn't work
        > every time. Sometimes it works, other times I get ugly
        > colors and when I check t_Co, it is set to 88 (which is
        > number of colors I specified for xterm install).

        The termcap query works asynchronously. Therefore it's unpredictable when the
        settings are done. Vim tries to get the values as soon as possible, but it
        depends on how quick xterm reacts (and how much time Vim leaves to other
        processes while it's starting up).

        The proper solution is to make sure your $TERM is set to match with the
        terminal you are actually using, which is with 88 colors. The termcap query
        feature helps you when $TERM is wrong, but it does have side effects (like
        changing t_Co at an unknown moment, which requires a complete redraw).

        --
        hundred-and-one symptoms of being an internet addict:
        60. As your car crashes through the guardrail on a mountain road, your first
        instinct is to search for the "back" button.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      Your message has been successfully submitted and would be delivered to recipients shortly.