I have a pretty similar problem as in this issue with some exceptions.

Basically, after I scroll page down or up Ctrl+d / Ctrl+u all non-empty lines get highlight from the end of the line to the right side of the screen. :nohlsearch doesn't change anything, highlight disappears only if I move a cursor with :set cursorline through them.

My .vimrc is here, I did a few steps because initially, I thought it's caused by some plugins interference:

  • I commented on all plugins and enabled only syntax - the issue still exists.
  • I commented part of vim setup except for syntax - the issue still exists.

I don't have any more ideas about what can cause it.

  • OS: Windows WSL - Ubuntu
  • VIM version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 23 2020 22:18:09) (compiled from source)

enter image description here

  • Welcome to Vi and Vim! Can you check whether this gets fixed if you use :set t_ut= with an empty value like that? See also: superuser.com/q/1526515/879179
    – filbranden
    May 26 '20 at 10:42
  • 1
    That's it! I was trying to change t_Co with no success but t_ut works like a charm. After the scroll, screen blink highlight for a moment but that's acceptable. If the source of the problem is the bug from the linked issue, I believe there's no fix for my machine yet. Personally I'm waiting for a build with WSL2, I hope it will work much smoother. I wish I could mark your comment as a solution.
    – Mishaszu
    May 26 '20 at 11:47
  • I'll post an answer. Thanks for confirming it works for you!
    – filbranden
    May 26 '20 at 11:49

This seems to be a bug in Microsoft Terminal](https://github.com/microsoft/terminal/issues/832) used in WSL.

The Windows Terminal doesn't support a feature called BCE but if Vim is configured to use an xterm style of terminal, it will try to use the feature and produce the artifacts you're currently seeing.

The bug has been fixed upstream,.but it looks like it might not have been released everywhere just yet.

See also this question.

A workaround you can use for this issue is to disable BCE in Vim itself, by using the following command in your vimrc:

set t_ut=

This means Vim will do extra work while scrolling (essentially using space characters to erase until the end of the line), which might make scrolling a little slower and might make the screen blink shortly while scrolling, but that might be acceptable until you can get a fixed Terminal with support for BCE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.