Monday, August 28, 2017

Re: how to set background color for vim terminal

Lifepillar wrote:

> On 28/08/2017 00:13, Bram Moolenaar wrote:
> >
> > Marcin Szamotulski wrote:
> >
> >> I was looking how to set up background color for the `:termainal` (on
> >> linux). I cannot find proper documentation on how to adjust libvterm.
> >
> > The program you run in the terminal can change the background.
> > Otherwise the same background as Vim is used.
> >
> > Note that on Mac it appears to be impossible to set the background color
> > to white. That's a problem with Terminal.app.
>
> In both Terminal.app and iTerm2 with notermguicolors, the terminal
> background is set to Vim's background, as you say. Not all of the 256
> colors look right, though. Attached you find a screenshot: the
> colorscheme is Solarized 8, although the particular colorscheme should
> not matter. See how a few of the 256 colors are out of place, and also
> a shade of gray is wrong. Of the system colors, Normal White (color 7)
> and Bright Black (color 8) are grey instead of Solarized white
> (#EEE8D5) and Solarized black (#333344), respectively. Note that this
> is what I see also in iTerm2, so this does not appear to be
> a terminal-specific problem (or, both terminals have the same issue).

Color 7 is supposed to be grey, but color 15 is supposed to be white.
You can try this with:
:hi Normal ctermbg=15

Has nothing to do with the terminal feature. This is with t_Co set to
256, which should be correct for Terminal.app.

> In iTerm2 with termguicolors, the terminal does not seem to inherit
> the colorscheme's colors, but it appears to always use default colors
> (the 256 color palette looks right in this case). In particular, the
> background is always white or black, depending on the value of
> 'background' at the moment the terminal is started. See the other two
> attachments. This is also what I see in MacVim.
>
> Finally, I have tried NeoVim's terminal for comparison, and colors
> appear to look right under all circumstances. So, it is definitely not
> "impossible" to correctly set all the 16 system colors (but, maybe,
> NeoVim is doing something hackish?).


--
In many of the more relaxed civilizations on the Outer Eastern Rim of the
Galaxy, "The Hitchhiker's Guide to the Galaxy" has already supplanted the
great "Encyclopedia Galactica" as the standard repository of all knowledge
and wisdom, for though it has many omissions and contains much that is
apocryphal, or at least wildly inaccurate, it scores over the older, more
pedestrian work in two important respects.
First, it is slightly cheaper; and second, it has the words "DON'T PANIC"
inscribed in large friendly letters on its cover.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

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