Vim does not correctly draw screen when scrolling

conemupowershellvim

When running vim on Windows from Powershell through ConEmu and using Ctrld and Ctrlu to scroll in vim the screen only draws part of the file.

Normal:

enter image description here

After pressing Ctrld:

enter image description here

After pressing Ctrll to force a redraw the screen then renders correctly again:

Is there a fix to cause the screen to always draw everything when using these commands?

EDIT: Setting the 'scroll' option to 9 or less appears to fix the problem as well, but this is not ideal and doesn't solve the root problem.

EDIT2: Setting the 'tsl' option to equal 0 instead of the default 999 gives desired behavior, but I still would like to know why this solved the problem.

Best Answer

Check the value of the TERM environment variable, Vim's terminal behaviour is set by this.

env | grep TERM

Ensure it is set to cygwin in order for vim to work correctly with ConEmu.

NB This also applies in Bash, where I had a similar redraw errors when TERM was incorrectly set to xterm.

Related Question