@elextr Thanks for pointing about printenv to compare. I found one that caused it. Now vim works the same. 
So in Geany TERM=xterm but in every other terminal TERM=xterm-256color.