I’ll admit I’m a little fuzzy on the details here. I found this response in a github issue on neovim.
This is how it works: When a UI is attached, it passes a “rgb” boolean parameter that tells nvim which kind of color/attributes should be sent. gui* attributes will be sent if rgb is true, cterm* attributes will be used otherwise.
Color schemes can be written in the same way as for vim, the difference is that cterm* and gui* are not mutually exclusive. So the color scheme should not check for
&term
orhas('gui_running')
because nvim will select the right attributes for each connected UI.
I’m not quite sure what “UI” is in this context and in what cases the “rgb” param would be true or not. I use neovim inside of iterm inside of a tmux session, but I also have enabled true color support in all my tools.
I believe that code sample worked for me, but if it isn’t working for you, it could be because of some automated rgb detection. Please let me know if you find any more detailed info. Thanks!