I recently moved from Ubuntu to WSL Ubuntu, and the only problem with the move seems to be how Vim displays in the terminal.

For example, I open a file in vim, and after exiting back into the command line, if I scroll up, I see the first line of the file I just exited: screenshot of problem

The problem compounds as I open and exit more files with vim. In fact, in every file I open with vim (after the first one), scrolling up also reveals the first lines of the previous vim sessions, just like in the command line: screenshot of problem

That was the result of scrolling up after opening my vimrc the second time.

The problem gets even worse if I do something like enter visual mode, select a block of text greater than the size of the terminal, and yank: screenshot of problem

In this case, the entire selection that was yanked is visible if I scroll up.

Here is a copy of my vimrc (without most of the comments, user-defined commands, and plugins) in the hopes that someone can help me fix this problem. The problem is unique to the Windows Terminal, and the terminal emulator being used is xterm-256color.

  • How are you scrolling - using arrow keys or ijkl?
    – cup
    Sep 7, 2020 at 8:06
  • The error can not be produced by scrolling using keybindings in vim since they don't go farther up if you hit the first line of the file. But in the Windows Terminal, I am able to still use the scroll bar in vim and in the command line, and using that is how I saw all of those problems. Sep 8, 2020 at 12:33

1 Answer 1


In order to disable the Windows Terminal Scrollbar

  1. Click on the ubuntu icon
  2. Select properties
  3. Select the layout tab
  4. Set the height and width of the screen buffer to the same value as the window size.

That will disable the scrollbar completely and you should be able to use normal linux command line scrolling.




In this picture, the screen buffer height and window size height are different. If they are both set to the same value (say 25) then the scrolling problem will disappear.

  • Can you be more specific? In the settings doc for the windows terminal, there's a profile for Ubuntu. What exact properties should I set? Sep 9, 2020 at 15:41
  • Select the layout tab - you will see the screen buffer and window size.
    – cup
    Sep 9, 2020 at 20:54
  • There is no layout tab. Sep 14, 2020 at 14:35
  • I've added pictures to indicate where the layout tab is.
    – cup
    Sep 14, 2020 at 15:53
  • Oh that's the Ubuntu App, not the Windows Terminal. Sep 15, 2020 at 1:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .