zellij
zellij copied to clipboard
NeoVim colors/theme is weird under ZelliJ
zellij --version
: (zellij 0.36.0) [installed via cargo install --locked zellij
]
stty size
: 44 174
uname -av
or ver
(Windows): Linux fednovo 6.2.14-300.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 1 00:55:28 UTC 2023 x86_64 GNU/Linux
nvim --version
:
NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
alacritty --version
: alacritty 0.12.0
Further information
When starting nvim in zellij, the theme is broken, it chooses the light theme, instead of dark, even tough vim.o.background
is set to "dark"
or vim.api.nvim_set_option('background', 'dark')
is called
The issue appears on alacritty and GNOME Console (the new one).
When opening nvim, it displays everything correctly:
Doing the same without zellij:
I have the following in my nvim config:
function ColorPlease(color)
color = color or "gruvbox"
vim.cmd.colorscheme(color)
vim.api.nvim_set_option('background', 'dark')
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end
ColorPlease()
Calling lua ColorPlease()
manually after NVIM is already loaded, and the broken theme is displayed, it fixes it.
I also tried deleting all my nvim directories (+ cache, + .local/share/nvim
) and installing NvChad where the same issue appers. Here i can also change the theme, after the issue appears, which also fixes it (But manually changing the theme every time is not an option)
I'm on Fedora 38, this issue does not appear on my other machine with Arch installed, even tough the config files should be the same (synced through git).
zellij.log
zellij-12.log
I had this problem and reported https://github.com/neovim/neovim/issues/22614. I think shows up for zellij because it takes a little longer to report the color than your terminal. Trying vim.schedule(ColorPlease)
might work (it did for me).
I had this problem and reported neovim/neovim#22614. I think shows up for zellij because it takes a little longer to report the color than your terminal. Trying
vim.schedule(ColorPlease)
might work (it did for me).
Thanks, this help, there is a short flash of light mode, then it switches. But for now it is a good workaround. Thx
Fix for Lazy Vim users:
init.lua
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
require("update_colors")
Create new file: lua/update_colors.lua
vim.schedule(function()
vim.cmd.colorscheme("catppuccin")
vim.api.nvim_set_option("background", "dark")
end)
This will get you back to the default color scheme.
Based on https://github.com/neovim/neovim/issues/22614, upgrading to neovim 0.9.1, fixed the issue for me.