The weird thing only happens when I open a C/C++ file. What I doing wrong here?
The moment when .cpp file open up.
About 0.1 sec later.
The version of related app and os.
nvim v0.10.0-dev
tmux 3.2a
alacritty 0.13.0-dev
Ubuntu 22.04
The theme and plugin what I used:
use 'morhetz/gruvbox'
use 'nvim-treesitter/nvim-treesitter'
This is what I have in my legacy.vim
" Colorscheme
set termguicolors
let g:gruvbox_contrast_dark='dark'
let g:gruvbox_contrast_light='hard'
colorscheme gruvbox
hi LspCxxHlGroupMemberVariable guifg=#83a598
This is my $TERM
insdie tmux:
$ echo $TERM
screen-256color
and in alacritty:
$ echo $TERM
alacritty
What i've tried so far:
in my .tmux.conf I tried
set -g default-terminal "screen-256color"
set -ag terminal-overrides ",screen-256color:RGB"
set -sa terminal-overrides ",screen-256color:RGB"
and
set -g default-terminal "screen-256color"
set-option -sa terminal-features ',screen-256color:RGB'
These doesn't work.
If I tried this in .tmux.conf file. Some of the colors would change, but there would still be a momentary flickering.
set -g default-terminal "screen-256color"
set-option -sa terminal-features ',alacritty:RGB'
and
$ tmux source-file ~/.tmux.conf
The moment when .cpp file open up.

About 0.1 sec later.

Well, I found the solution.
The reason is that there is a legacy parser from before. I didn't not clean the settings properly.
Before reinstalling Neovim, I used the :checkhealth command to check out the status.
The Nvim runtime ABI version is 14, but Parser C is 13.
So, I reinstall neovim, and clean all the settings in ~/.local/share/nvim. and checkout status again. And it works!