3

I have install WSL and i am using Debian. Every time i clear the screen and start typing from the "top" of the console WSL will for some reason scroll down by about 50 lines or so. If i scroll back to the top of the console and type again it will do the same thing.

The only way i can use WSL is if i hit enter above 50 times until there is about 50 lines or so on the screen then it will stop this scrolling nonsense... Has anyone seen this before? If so how did you fix it?

5
  • 1
    Type clear;clear instead of one clear.
    – Biswapriyo
    Commented Aug 12, 2019 at 19:10
  • wow. that worked... what is the idea behind that? Why do i have to do that?
    – matt
    Commented Aug 12, 2019 at 22:14
  • @Biswapriyo you can add your comment as an answer with the explanation that matt is asking Commented Aug 13, 2019 at 15:57
  • He dosnt know it, probably copy pasted from somewhere, people are suggesting to use clear -x as it won't clear the scroll buffer, you can learn more about it by visiting man clear, Commented Oct 13, 2023 at 11:57
  • BTW clear -x doesn't work either, it keeps scrolling down Commented Oct 13, 2023 at 12:05

2 Answers 2

3

Add this to your .bashrc:

# Fix 'clear' scrolling issues
alias clear='clear -x'

Source: https://github.com/WhitewaterFoundry/pengwin-base/blob/a19d8330d6cbb4aa8f3b3b5cda4cd41770a4d18b/profile.d/00-pengwin.sh#L10

Pengwin

Regards

1
  • What does this do?
    – Richard
    Commented Jun 20, 2022 at 10:53
0

You would do the command clear -x every time you want to clear the screen or add alias clear='clear -x' to your aliases in the .bashrc file. logout and login again for the changes to take effect.

You must log in to answer this question.

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