[vim/vim] Can't get transparent background with termguicolors enabled (#981)

4,429 views
Skip to first unread message

Francisco Lopes

unread,
Aug 14, 2016, 11:40:23 AM8/14/16
to vim/vim

I've enabled true colors for Vim with success using:

 set t_8f=\[[38;2;%lu;%lu;%lum
 set t_8b=\[[48;2;%lu;%lu;%lum
 set termguicolors

(check :h xterm-true-color for more information)

I have then enabled a true color colorscheme to try the new setting, like:

set background=dark
colors deep-space

(https://github.com/tyrannicaltoucan/vim-deep-space)

Previously when using 256 colors I was able to get a transparent background by:

hi! Normal ctermbg=NONE guibg=NONE
hi! NonText ctermbg=NONE guibg=NONE

Now, this is not working anymore and I don't know any alternative. Is it supported to get transparent background with Vim under termguicolors?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, .

Jun Lin

unread,
Aug 23, 2016, 4:45:34 AM8/23/16
to vim/vim

I use the same colorscheme as you.
I found I could get a transparent background outside tmux.
when I open vim inside tmux, I got the problem like you.

hi! Normal ctermbg=NONE guibg=NONE
hi! NonText ctermbg=NONE guibg=NONE

These two lines also not work for me.

BTW, my TERM value is xterm-256color


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or mute the thread.

Christian Brabandt

unread,
Aug 23, 2016, 2:10:24 PM8/23/16
to vim/vim

your TERM in tmux needs to be screen-256color or screen-256color-bce

Francisco Lopes

unread,
Aug 23, 2016, 2:37:27 PM8/23/16
to vim/vim

I use tmux myself and have correctly setup it for true colors through the following setting:

# Enable 24 bit true colors
set -ga terminal-overrides ',xterm-256color:Tc'

Despite that, let's assume this report is about Vim without tmux, I don't want to involve yet another variable. I have the issue with Vim outside the tmux as well, can't get transparent background through true colours in any way. I have indeed heard that true colours got support from NeoVim first and that there the behaviour may be different.

Jun Lin

unread,
Aug 23, 2016, 9:54:53 PM8/23/16
to vim/vim

sorry I add a new variable to you @oblitum . I'm not sure whether should I open an issue.

@chrisbra I can't let TERM be screen-256color or screen-256color-bce. If so, my vim inside tmux will mess up all colors. I have to set TERM with set-option -g default-terminal "xterm-256color".

Francisco Lopes

unread,
Aug 23, 2016, 10:34:30 PM8/23/16
to vim/vim

@sfwn I had the tmux problem initially too, and thought the solution was to set TERM to xterm-256color, but that's not correct. I fixed the situation correctly by setting set -ga terminal-overrides ',xterm-256color:Tc' and setting this on my .vimrc:

if has("termguicolors")     " set true colors
    set t_8f=\[[38;2;%lu;%lu;%lum
    set t_8b=\[[48;2;%lu;%lu;%lum
    set termguicolors
endif

where \[ is ESC. Check :h xterm-true-color about this and how to input ESC.

Francisco Lopes

unread,
Aug 23, 2016, 10:36:38 PM8/23/16
to vim/vim

You should restart tmux after applying the terminal-overrides setting, and correctly setting t_8f and t_8b in vim is necessary for it to work with true colors inside tmux.

Jun Lin

unread,
Aug 23, 2016, 10:42:30 PM8/23/16
to vim/vim

@oblitum
I tried several times through set t_8f and t_8b but failed. I know it's my question about setting \[, let me try now again.

Jun Lin

unread,
Aug 23, 2016, 10:56:29 PM8/23/16
to vim/vim

sorry but I reallly don't know how to (replace ^[ with real escape).

K.Takata

unread,
Aug 23, 2016, 11:01:19 PM8/23/16
to vim/vim

sorry but I reallly don't know how to (replace ^[ with real escape).

See #993 (comment)

Jun Lin

unread,
Aug 23, 2016, 11:05:04 PM8/23/16
to vim/vim

@k-takata
Tks, I got it and success ☺️

Jun Lin

unread,
Aug 23, 2016, 11:10:13 PM8/23/16
to vim/vim

@oblitum

After set

set -ga terminal-overrides ',xterm-256color:Tc'
set -g default-terminal "screen-256color"

in ~/.tmux.conf

and set

if has("termguicolors")     " set true colors
    set t_8f=\[[38;2;%lu;%lu;%lum
    set t_8b=\[[48;2;%lu;%lu;%lum
    set termguicolors
endif

in ~/.vimrc, now I do have transparent background inside&outside tmux.

Francisco Lopes

unread,
Aug 24, 2016, 12:35:42 AM8/24/16
to vim/vim

@sfwn Hi. Sorry but I think your problem is another one and is unrelated with the issue here. I'd not like to mix it with the issue being reported.

Francisco Lopes

unread,
Aug 24, 2016, 12:43:30 AM8/24/16
to vim/vim

@sfwn I'm saying that because, for me, the issue happens regardless of using tmux or not.

Francisco Lopes

unread,
Aug 24, 2016, 12:51:59 AM8/24/16
to vim/vim

I'd like to add to my report that :hi! Normal ctermbg=NONE guibg=NONE is not having any effect at all. When I execute :hi! Normal ctermbg=0 guibg=#000000, my background is changed to black, then when I execute :hi! Normal ctermbg=NONE guibg=NONE, the background stays black, so :hi! Normal ctermbg=NONE guibg=NONE is in reality doing nothing.

Jun Lin

unread,
Aug 24, 2016, 12:55:47 AM8/24/16
to vim/vim

@oblitum :)

Francisco Lopes

unread,
Aug 26, 2016, 12:49:42 AM8/26/16
to vim/vim

For what's worth, on NeoVim, the exact same configuration works to get the transparent background.

Francisco Lopes

unread,
Aug 26, 2016, 12:49:54 AM8/26/16
to vim/vim

Even inside tmux.

Lifepillar

unread,
Aug 26, 2016, 5:13:30 AM8/26/16
to vim/vim

I can reproduce the exact problem described by the OP with Vim 7.4p2235 in iTerm2 (OS X), both inside and outside tmux (other than that, I see correct true colors both inside and outside tmux). Just for completeness, this is the relevant snippet from my .vimrc:

if has('termguicolors') && $TERM_PROGRAM ==# 'iTerm.app'
  set t_8f=^[[38;2;%lu;%lu;%lum
  set t_8b=^[[48;2;%lu;%lu;%lum
  set termguicolors
endif

To reproduce, start Vim with the above configuration (whether you're in tmux doesn't really matter) and type:

:hi Normal ctermbg=NONE guifg=NONE
:set notermguicolors
:set termguicolors

The result is:

  1. the background does not change;
  2. the background becomes transparent;
  3. the background becomes opaque again.

Lifepillar

unread,
Aug 26, 2016, 5:27:16 AM8/26/16
to vim/vim

Ops, the command in my previous post should be: :hi! Normal ctermbg=NONE guibg=NONE.

nuko8

unread,
Aug 26, 2016, 9:46:37 PM8/26/16
to vim/vim

@oblitum

Your description of the issue is terribly confusing and thus misleading people.

You brought us three confusions.

It is true that, when Vim did not support 24-bit colors yet, you were able to get transparent background by setting

hi! Normal ctermbg=NONE

But guibg=NONE was nothing to do with that because they were used to specify colors only for GVim those days.

Now Vim supports 24-bit colors and, when termguicolors is enabled, it uses pixel values specified by guifg and guibg to paint colors. Note that, in this case, both ctermfg and ctermbg are not used.

So, I'm wondering how you could conclude from those two facts that

hi! Normal ctermbg=NONE guibg=NONE

would give you transparent background when termguicolors was enabled. How could you infer that ctermbg=NONE for non-24-bit color could correspond to guibg=NONE for 24-bit color?

This is Confusion No. 1.

Next. You wrote:

The exact same configuration works on NeoVim 0.1.5.

and

on NeoVim, the exact same configuration works to get the transparent background

As I’ve never used that editor, I don't know much about it but once heard that it had no GUI.

Then, does it really have guibg? What is that for with such a non-GUI editor? How can "the exact same configuration" be possible?

Note that Vim has a series of decent GUIs ranging from Linux to Windows, called GVim collectively.

Needless to say, every guibg in highlight groups has a substantial role in GVim to determine a background color. Using guibg to give transparent background to a terminal application which has full-fledged GUI versions, sounds like almost a joke and is confusing.

Try deep-space with one of our GUIs and do :hi! Normal guibg=NONE there. What do you think happens with it? Yes, that completely ruins the colorscheme.

This is Confusion No. 2.

Or, for the editor you mentioned, this hypothesis might be possible: While guibg=NONE is ignored, ctermbg=NONE would has an effect to make the background transparent.

If this is the case, you must remember that, as I wrote previously, in Vim, enabling termguicolors means choosing colors from the values of guifgs and guibgs, not from ctermfgs or ctermbgs.

Even if ctermbg=NONE could give transparent background to another editor, that’s nothing to do with termguicolors enabled Vim. The background color is chosen from guibg.

This is Confusion No. 3.

What is your real issue? Could you clarify that, if any?

Actually, you can get a transparent background version of deep-space by

--- deep-space.vim  2016-08-14 16:24:48.000000000 +0000
+++ deep-space2.vim 2016-08-16 06:59:20.000000000 +0000
@@ -75,7 +75,11 @@
 call s:HL('ModeMsg',                        s:green,    '',         '')
 call s:HL('MoreMsg',                        s:green,    '',         '')
 call s:HL('NonText',                        s:gray3,    '',         '')
-call s:HL('Normal',                         s:gray4,    s:gray0,    'none')
+if has('gui_running')
+    call s:HL('Normal',                     s:gray4,    s:gray0,    'none')
+else
+    call s:HL('Normal',                     s:gray4,    '',    'none')
+endif
 call s:HL('Pmenu',                          s:gray4,    s:gray2,    '')
 call s:HL('PmenuSbar',                      s:gray3,    s:gray4,    '')
 call s:HL('PmenuSel',

What makes you think "Can't get transparent background with termguicolors enabled"?

James McCoy

unread,
Aug 26, 2016, 10:04:02 PM8/26/16
to vim/vim

As I’ve never used that editor, I don't know much about it but once heard that it had no GUI.

Neither do builds of Vim which don't enable the GUI components. There are GUIs for Neovim, they're just different projects.

Then, does it really have guibg? What is that for with such a non-GUI editor?

Yes, just like Vim does even if it isn't built with a GUI. 'termguicolors' is only relevant for ... the terminal. Storing guibg/guifg attributes when parsing :hi commands has nothing to do with actually using a GUI.

How can "the exact same configuration" be possible?

Easy. It's just a couple cp or ln commands.

Francisco Lopes

unread,
Aug 26, 2016, 10:26:13 PM8/26/16
to vim/vim

@nuko8 Why this level of condescension? I've opened an issue clearly showing that I was looking for options, since I didn't known any. I think my intention was fairly clear.

This is my actual relevant .vimrc configuration which I use both for vim/gvim/nvim (NeoVim terminal):

if has("termguicolors") && has("nvim") " set true colors on NeoVim
    set t_8f=�[38;2;%lu;%lu;%lum
    set t_8b=�[48;2;%lu;%lu;%lum
    set termguicolors
endif
set background=dark
colors deep-space
"colors seoul256-light
hi! link Conceal Normal
if !has('gui_running')
    hi! Normal ctermbg=NONE guibg=NONE
    hi! NonText ctermbg=NONE guibg=NONE
endif

On Vim (terminal) it's falling back to 256 colors (not enabling termguicolors) because my hi! Normal ctermbg=NONE guibg=NONE patch doesn't work there, on NeoVim it's enabling termguicolors since that highlighting patch does work to get transparent background on NeoVim. In any case, in GUI I don't care for transparent background, hence in GUI versions I simply don't execute the highlighting patch.

As you may check, I indeed did know a bit about the differences regarding terminal and GUI instances, anyway, is it so important to bring yet another variable to my question? My question is about terminal vim (termguicolors), not GVim et. al., I've already removed tmux from the discussion (that got mentioned by other user) to reduce scope.

I'm not looking to patch a specific colorscheme for that, the solution I'm looking for should resemble my old one, which still works on NeoVim, which is to patch highlighting from .vimrc to get transparent background for any colorscheme.

I don't know but, this kind of answer seems a bit harsh and it's not the first time I get it out of a sudden. This makes a non-welcoming community and foster people to go for alternatives.

nuko8

unread,
Aug 26, 2016, 10:41:42 PM8/26/16
to vim/vim

is it so important to bring yet another variable to my question?

Yes, absolutely. We need to take all users, in particular, GUI users in this case, as well as you into consideration to struggle for a reasonable solution with which most of them are satisfied.

this kind of answer seems a bit harsh and it's not the first time I get it out of a sudden. This makes a non-welcoming community and foster people to go for alternatives.

The principle is simple. I'm personally against someone which asks us for changing something for his own interest only at the expense of other users' benefits.

Francisco Lopes

unread,
Aug 26, 2016, 10:44:32 PM8/26/16
to vim/vim

Please read my initial question. I didn't ask for a change, I simply asked.

nuko8

unread,
Aug 26, 2016, 11:03:16 PM8/26/16
to vim/vim

Is it supported to get transparent background with Vim under termguicolors?

Yes, it is supported. You can freely change color schemes at runtime through :colorscheme, no matter what background, opaque or transparent.

As expalained above, you cannot use hi! Normal guibg=NONE to make background transparent at runtime.

We might introduce a new set option to make that possible, but we've not received this kind of proposal or request so far.

Francisco Lopes

unread,
Aug 26, 2016, 11:41:51 PM8/26/16
to vim/vim

@nuko8 OK. At last, thanks for the answer. I've verified your patch applied to the specific colorscheme and it does work.

Since to me the fact that one is able get transparent background at runtime for notermguicolors but can't for termguicolors seems a discrepancy, I'll leave this open for anyone responsible to close as wontfix or bug.

Since because of this issue I've tried NeoVim for the first time and it seems to simply work with my .vimrc and plugins without almost any changes, my personal solution meanwhile will be to stick to it.

nuko8

unread,
Aug 27, 2016, 2:46:52 AM8/27/16
to vim/vim

I've verified your patch applied to the specific colorscheme and it does work.

Thank you for the check.

Since to me the fact of being able to get transparent background at runtime for notermguicolors but not being able to for termguicolors seems a discrepancy, I'll leave this open for anyone responsible to close it as wontfix or bug.

Makes sense. Now I understand what you really want.

Since because of this issue I've tried NeoVim for the first time and it seems to simply work with my .vimrc and plugins without almost any changes, my personal solution meanwhile will be to stick to it

Thanks to @jamessan's comment, now I see there was an unfortunate misunderstanding between us, and that you're not the one who is solely to blame for that. Before writing my first comment, I should have asked you about NeoVim and been aware of the discrepancy between it and Vim.

Christian Brabandt

unread,
Aug 27, 2016, 3:47:00 PM8/27/16
to vim/vim
Hi Francisco!

On Fr, 26 Aug 2016, Francisco Lopes wrote:

> I don't know but, this kind of answer seems a bit harsh and [it's not
> the first time](https://github.com/vim/vim/issues/909) I get it out of

> a sudden. This makes a non-welcoming community and foster people to go
> for alternatives.

I am sorry, if my answer back felt harsh. However, the bug report wasn't
very easily understandable and it is always good to be as precise as
possible to help the developers understand the request.

If you want, you can also see it from the other side: If you simply dump
some log file, you won't motivate us, to try to understand what your
problem is.

Best,
Christian
--
Ein Übermaß an Hoffnung ist nicht ungefährlich. Es wirkt wie örtliche
Betäubung der Tatkraft.
-- Thornton Niven Wilder

Francisco Lopes

unread,
Nov 28, 2016, 10:27:54 AM11/28/16
to vim/vim

Bump.

This is still an issue:

Since to me the fact of being able to get transparent background at runtime for notermguicolors but not being able to for termguicolors seems a discrepancy, I'll leave this open for anyone responsible to close it as wontfix or bug.

Since because of this issue I've tried NeoVim for the first time and it seems to simply work with my .vimrc and plugins without almost any changes, my personal solution meanwhile will be to stick to it.

Nate Bhurinat Wangsutthitham

unread,
Dec 2, 2016, 5:05:38 AM12/2/16
to vim/vim

Still receiving the same issue:

set termguicolors would not render background transparent
set notermguicolors would render background transparent

Nate Bhurinat Wangsutthitham

unread,
Dec 2, 2016, 5:11:56 AM12/2/16
to vim/vim

Additional comment: it seems that normal Terminal.app on macOS works with properly, I've tried the configurations on HyperJs, iTerm and default Terminal.app.

All of the terminals report $TERM = xterm-256color

nuko8

unread,
Dec 2, 2016, 7:33:41 AM12/2/16
to vim/vim

normal Terminal.app on macOS works with properly

Try and run the following command-line on Terminal.app and see if Terminal.app is true-color capable or not for yourself:

printf "\x1b[38;2;255;000;000mYou see red?\x1b[0m\n" 

If it is true-color capable, you'll see characters in red; otherwise, your argument doesn't make sense.

chdiza

unread,
Dec 2, 2016, 9:36:18 AM12/2/16
to vim/vim

Terminal.app is NOT true-color capable. I don't know why people keep thinking it is.

Nate Bhurinat Wangsutthitham

unread,
Dec 2, 2016, 10:47:53 AM12/2/16
to vim/vim

I'm not saying that it (Terminal.app) supports true colour however I wanted to emphasise that transparent background works without true colour mode.

Nate Bhurinat Wangsutthitham

unread,
Dec 2, 2016, 10:49:24 AM12/2/16
to vim/vim

Plus, neovim works with either of the options.

nuko8

unread,
Dec 2, 2016, 12:18:27 PM12/2/16
to vim/vim

On iTerm2, which is capable of true-color, you can get the background to be translucent or transparent even if you specify a solid color for guifg of highlight Normal with set termguicolor.

How to set up that terminal or another piece of software is definitely out of place for this issue tracker, IMHO.

Lifepillar

unread,
Dec 2, 2016, 1:13:42 PM12/2/16
to vim/vim

I am not sure I understand the issues recently reported. @nuko8's explanation was quite clear, and in fact I have updated a couple of colorschemes of mine (Solarized 8 and WWDC16) to support transparent backgrounds after @nuko8's comments. They work for me in Terminal.app and iTerm2, within or without tmux.

I'd suggest people still having problems with transparent background to try the following:

  1. set a background image in your terminal (to make it easier to see if the background in Vim is transparent);
  2. set termguicolors in your vimrc.
  3. Install Solarized 8 and let g:solarized_termtrans=1 in your vimrc (or download WWDC16 and let let g:wwdc16_term_trans_bg=1).
  4. Make sure you are not in tmux (tmux may require additional settings in your virmc).
  5. Run Vim.

Vim's background should be transparent (you should see the background image), no matter if your terminal supports true colors or not. If that is the case, and you don't get a transparent background with other colorschemes, I think that the problem is in those colorschemes.

Francisco Lopes

unread,
Dec 2, 2016, 1:37:42 PM12/2/16
to vim/vim

At this moment this issue is solely about:

Since to me the fact of being able to get transparent background at runtime for notermguicolors but not being able to for termguicolors seems a discrepancy, I'll leave this open for anyone responsible to close it as wontfix or bug.

Meaning, you are able to tweak the background to transparent after finishing loading a colorscheme with opaque background, using the following on your .vimrc:

    hi! Normal ctermbg=NONE guibg=NONE
    hi! NonText ctermbg=NONE guibg=NONE

This works and has been working for quite some time with notermguicolors, but has no effect for termguicolors.

For comparison, on NeoVim, setting the background to None on either case works as expected, it respects the original behavior of getting a transparent background.

I've bumped the issue for this.

Nate Bhurinat Wangsutthitham

unread,
Dec 2, 2016, 1:51:28 PM12/2/16
to vim/vim

It seems that my wordings it not clear,

@oblitum totally clear things up and said what I wanted to say.

@lifepillar I don't know about those colorscheme, maybe there is something I left off after walk-through the code. @nuko8 Yes I had my iTerm set-up properly

Lifepillar

unread,
Dec 2, 2016, 1:53:30 PM12/2/16
to vim/vim

@oblitum I don't see any difference in Terminal.app between Vim and NeoVim: setting

hi! Normal ctermbg=NONE guibg=NONE

does immediately set a transparent background in both cases. For iTerm2, however, you are right: Vim sets the transparency only when (re)loading the colorscheme.

Francisco Lopes

unread,
Dec 2, 2016, 1:55:50 PM12/2/16
to vim/vim

@lifepillar the testcase is:

  • Set termguicolors and whatever is necessary for true colors.
  • Load an opaque background colorscheme first.
  • execute hi! Normal ctermbg=NONE guibg=NONE and see whether background got transparent.

Francisco Lopes

unread,
Dec 2, 2016, 1:59:12 PM12/2/16
to vim/vim

@ThePooE you may still get transparent background if you modify your colorscheme directly as @nuko8 commented at #981 (comment). You just can't get it transparent afterwards.

Francisco Lopes

unread,
Dec 2, 2016, 2:05:10 PM12/2/16
to vim/vim

This issue is weird because it makes it possible not being able to revert to an original true colors colorscheme that employs a transparent background. If you then set hi! Normal guibg=<some opaque color>, you can't get back to original transparent state anymore, except by restarting Vim.

Lifepillar

unread,
Dec 2, 2016, 2:09:52 PM12/2/16
to vim/vim

@oblitum @ThePooE As I said, your testcase passes in Terminal.app. I have no Linux box locally, but your testcase passes if I run Vim remotely on a Linux terminal (even if I open an SSH session from iTerm2).

So, the only terminal where the testcase fails (among those that I've tried) is iTerm2.

Re your last comment, in Terminal.app, if the current colorscheme has a transparent background and I set an opaque color, the background stays transparent. In iTerm2 it becomes opaque, but I can get it transparent again by reloading the colorscheme.

Lifepillar

unread,
Dec 2, 2016, 2:20:24 PM12/2/16
to vim/vim

Aaargh. Sorry, I forgot that I am not setting termiguicolors in Terminal.app (because, of course, it doesn't support true colors).

So, in the only true color terminal I can try now (iTerm2), I agree that highlight commands behave differently according to whether termguicolors is set or not.

Francisco Lopes

unread,
Dec 2, 2016, 2:21:31 PM12/2/16
to vim/vim

@lifepillar

in Terminal.app, if the current colorscheme has a transparent background and I set an opaque color, the background stays transparent.

Strange, seems worth a report.

Regarding terminal emulator behaviour for "dynamic transparency", I'm unable to get it on whatever emulator I tried on Linux, I use xfce4-terminal-devel, where it works on NeoVim but not on Vim. Formerly I also tried others if I recall correctly (gnome terminal), but also got the same.

Francisco Lopes

unread,
Dec 2, 2016, 2:22:12 PM12/2/16
to vim/vim

@lifepillar

Aaargh. Sorry, I forgot that I am not setting termiguicolors in Terminal.app (because, of course, it doesn't support true colors).

OK.

Lifepillar

unread,
Dec 2, 2016, 2:33:00 PM12/2/16
to vim/vim

Anyway, @nuko8 has clearly said that you should not expect hi! Normal guibg=NONE to set a transparent background in a true-color terminal:

every guibg in highlight groups has a substantial role in GVim to determine a background color. Using guibg to give transparent background to a terminal application which has full-fledged GUI versions, sounds like almost a joke and is confusing.

NeoVim does it, however (hi! Normal guibg=NONE sets a transparent background in NeoVim, so it doesn't seem to fallback to the value of ctermbg). They may have been able to do it because there is no “GNeoVim”. Just guessing…

Francisco Lopes

unread,
Dec 2, 2016, 3:35:05 PM12/2/16
to vim/vim

@lifepillar NeoVim has (3rd party) graphical frontends, I just don't use any, but I do see in issue tracker that they do care about them.

Regarding GVim, is one able to get transparency on it? It never worked for me, nor did I expect it to work.

Francisco Lopes

unread,
Dec 2, 2016, 3:37:19 PM12/2/16
to vim/vim

@lifepillar regarding his argument, you may check my point of view here: #1118 (comment).

nuko8

unread,
Dec 3, 2016, 9:58:26 AM12/3/16
to vim/vim

For people who consider that the issue of this thread really matters, try the following patch if you will:

diff --git a/src/syntax.c b/src/syntax.c
index 75ede36..fbb7fab 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -8227,6 +8227,24 @@ set_normal_colors(void)
 		cterm_normal_bg_gui_color = HL_TABLE()[idx].sg_gui_bg;
 		must_redraw = CLEAR;
 	    }
+	    else if (p_tgc && !gui.in_use)
+	    {
+		/* Now that "... .sg_gui_bg == INVALCOLOR" holds as well as
+		 * the conditions of the else-if statement above, it is highly
+		 * likely that ":hi Normal guibg=NONE" has been invoked by the
+		 * user running termguicolors-enabled Vim on terminal to get
+		 * the translucent background.  Honor it. */
+		if (HL_TABLE()[idx].sg_gui_bg_name)
+		{
+		    /* Update sg_gui_bg_name accordingly in case it still
+		     * holds the previous value, so that it will be consistent
+		     * with the current state of sg_gui_bg. */
+		    vim_free(HL_TABLE()[idx].sg_gui_bg_name);
+		    HL_TABLE()[idx].sg_gui_bg_name = NULL;
+		}
+		cterm_normal_bg_gui_color = INVALCOLOR;
+		must_redraw = CLEAR;
+	    }
 	}
     }
 #endif

Francisco Lopes

unread,
Dec 4, 2016, 3:46:28 PM12/4/16
to vim/vim

@nuko8 I've tried your patch and it works fine as far as I've tried, thanks. I hope it or similar gets upstream and settle this.

duganchen

unread,
Aug 5, 2017, 4:20:12 PM8/5/17
to vim/vim, Subscribed

@sfwn The problem in #981 (comment) is your terminal. I get that behavior in Terminator 1.91, but not in Konsole, Terminal.app or iterm2.

Bram Moolenaar

unread,
Feb 27, 2018, 7:05:53 AM2/27/18
to vim/vim, Subscribed

Closed #981 via 33ef5bb.

zreus

unread,
Mar 9, 2021, 11:45:03 PM3/9/21
to vim/vim, vim-dev ML, Manual

i fixed with this
hi NonText guifg=250 guifg=none hi Normal guifg=252 guibg=none


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Adam Temple

unread,
Mar 18, 2021, 2:01:25 PM3/18/21
to vim/vim, vim-dev ML, Manual

I am using jellybeans colorscheme. The only way I was able to get a transparent background was to set the following:

colorscheme jellybeans
" set transparent background - jellybeans specific
let g:jellybeans_overrides = {
\    'background': { 'ctermbg': 'none', '256ctermbg': 'none' },
\}
if has('termguicolors') && &termguicolors
    let g:jellybeans_overrides['background']['guibg'] = 'none'
endif

As described by the jellybeans author: https://nicedoc.io/nanotech/jellybeans.vim

Reply all
Reply to author
Forward
0 new messages