norcalli / nvim-colorizer.lua

The fastest Neovim colorizer.
Other
2.23k stars 117 forks source link

Bug: &termguicolors must be set on WSL windows terminal #96

Open somecho opened 1 year ago

somecho commented 1 year ago

Describe the bug On Windows Terminal using WSL2, initializing colorizer in init.lua causes the error &termguicolors must be set

Operating System: Debian 11 Neovim Version: 0.8.3 Colorizer Version: 36c610a

mentos1386 commented 11 months ago

Make sure you have set termguicolors defined before calling setup().

I have the following in my init.vim:

set termguicolors
lua require'colorizer'.setup()
vereym commented 9 months ago

I have the same issue on nixos and I have vim.o.termguicolors = true defined in my init.lua so maybe it's a lua config problem?

mbpowers commented 7 months ago

It looks like termguicolors=true is now the default but it is set after VimEnter according to this and this and is maybe related. I am not getting the termguicolor missing error when I set it in my config, but when I do set it, I encounter a different bug. Since setting it is redundant now I would like to remove that but that causes this plugin to complain unnecessarily.

Seems like we should either remove this warning as someone would have to intentionally disable termguicolors now or check at if its enabled some point after VimEnter. Thoughts?

Vixima commented 6 months ago

similar problem on my arch install, i have o.termguicolors = true in an options.lua where i keep any vim.cmd, vim.g, and vim.opt stuff set, it gets loaded by init.lua.

shyun3 commented 3 months ago

As of Neovim 0.10, termguicolors is enabled by default if Neovim detects that the terminal supports 24-bit color. It would be nice if the plugin could pick up on this instead of relying on the user to set termguicolors manually.