-
Neovim version: 0.6.1
-
Vim 8.2.2019 behaves correctly (not the same).
-
OS: both arch linux and manjaro
-
Terminals: both alacritty and kitty.
-
$TERM environment: xterm-256color, alacirty …etc
-
installation: pacman
-
How to reproduce the issue:
1- nvim version 6.1 (default installation no config)
2- tmux 3.2a (default installation no config)
3- set your terminal emulator to a light theme (I use Gruvbox light).
4- Open nvim in tmux, you will notice that it’s hard to read text in tmux. -
Expected behaviour:
It should use the terminal emulator color scheme in tmux like Vim. Not force a fixed colorscheme that doesn’t fit the background color (in this case light background).
On the internet you can find solutins like “set the background to black” and “colorscheme yourcolorchoice”, but what about people who just want the default color of their terminal!. -
Actual behaviour:
The colors you get in tmux are exactly as if you setcolorscheme default
Have you read :h 'background'
?
Let me quote the first two paragraphs for you:
'background' 'bg' string (default "dark")
global
When set to "dark" or "light", adjusts the default color groups for
that background type. The |TUI| or other UI sets this on startup
(triggering |OptionSet|) if it can detect the background color.
This option does NOT change the background color, it tells Nvim what
the "inherited" (terminal/GUI) background looks like.
See |:hi-normal| if you want to set the background color explicitly.
The issue here seems to be that tmux doesn’t inform neovim of what the outer terminals background colour is, something that isn’t really a solvable problem given that the same tmux pane can be attached to from multiple terminals at once.
Vim 8.2.2019 behaves correctly (not the same).
It doesn’t actually, vim just defaults to set background=light
.