I use KDE, so added 'set term=konsole-256color' to my .vimrc file.
I see that I have in my .vimrc the following: if ($TERM!="") :set invttybuiltin term=$TERM endif
So I tried setting TERM to konsole-256color and it worked.
In fact I followed this suggestion for setting TERM:
"Settings → Profiles, then for each profile Edit Profile → General → Environment: [ Edit… ]"
Frédéric