how to set background color for vim terminal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

how to set background color for vim terminal

Marcin Szamotulski
Hi Vim_Use,

I was looking how to set up background color for the `:termainal` (on
linux).  I cannot find proper documentation on how to adjust libvterm.

Best regards,
Marcin Szamotulski

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to set background color for vim terminal

Bram Moolenaar

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.

--
How To Keep A Healthy Level Of Insanity:
18. When leaving the zoo, start running towards the parking lot,
    yelling "run for your lives, they're loose!!"

 /// Bram Moolenaar -- [hidden email] -- 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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to set background color for vim terminal

Lifepillar
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).

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?).

Life.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

vim_iterm_termguicolors_dark.png (45K) Download Attachment
vim_iterm_termguicolors.png (40K) Download Attachment
vim_terminal_palette.png (33K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to set background color for vim terminal

Marcin Szamotulski
On 10:24 Mon 28 Aug     , 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).
>
> 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?).
>
> Life.
>
> --
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.
I am on Linux though.  And I can set background background through bash or
zsh escape sequences but that's not very reliable.   When using ls or man
it will break in one way or the other (ls will often show patches of the
original background color, man will just use the default terminal
background color).   When running an xterm I just use the `-bg` flag
which works perfectly fine (or just set up things in .Xresources file).
Is there a such a way with libvterm?

I see very similar behaviour that Lifepillar has.  The background is
white or black rather than what is in `:hi Normal`.

Best regards,
Marcin

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to set background color for vim terminal

Bram Moolenaar
In reply to this post by Lifepillar

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 -- [hidden email] -- 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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: how to set background color for vim terminal

Marcin Szamotulski
On 16:15 Mon 28 Aug     , Bram Moolenaar wrote:

>
> 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?).
I can confirm that with the guitermcolors option indeed the only
background colour I see is black or white.

Best regards,
Marcin

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (201 bytes) Download Attachment