Less Pollutes Scrollback Buffer in WSL/Ubuntu #7233

Closed
opened 2026-01-31 00:58:33 +00:00 by claunia · 3 comments
Owner

Originally created by @lvfrazao on GitHub (Mar 31, 2020).

Environment

Windows build number: Microsoft Windows NT 10.0.18363.0
Windows Terminal version (if applicable): Version: 0.10.781.0

Any other software?
WSL v1
less 
$ less --version
less 487 (GNU regular expressions)
Copyright (C) 1984-2016  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Homepage: http://www.greenwoodsoftware.com/less

Steps to reproduce

  1. Generate file with random text (enough lines to fill up the screen): $ head -1000 /dev/urandom | tr -dc A-Za-z0-9 > rand.txt
  2. Fill scrollback with content: $ for i in {1..100}; do echo $i; done;
  3. Open file with random text with less: $ less rand.txt
  4. Use the down arrow or pgdn keys to scroll down a bit
  5. Exit less and scroll up

Expected behavior

Scrolling up shows input and output from previous terminal commands.

Actual behavior

Scrolling up shows the lines that were viewed in less and overwrites the previous output.

wt_issue

This may be a duplicate of: https://github.com/microsoft/terminal/issues/3492

Originally created by @lvfrazao on GitHub (Mar 31, 2020). # Environment ```none Windows build number: Microsoft Windows NT 10.0.18363.0 Windows Terminal version (if applicable): Version: 0.10.781.0 Any other software? WSL v1 less $ less --version less 487 (GNU regular expressions) Copyright (C) 1984-2016 Mark Nudelman less comes with NO WARRANTY, to the extent permitted by law. For information about the terms of redistribution, see the file named README in the less distribution. Homepage: http://www.greenwoodsoftware.com/less ``` # Steps to reproduce 1. Generate file with random text (enough lines to fill up the screen): `$ head -1000 /dev/urandom | tr -dc A-Za-z0-9 > rand.txt` 2. Fill scrollback with content: `$ for i in {1..100}; do echo $i; done;` 3. Open file with random text with less: `$ less rand.txt` 4. Use the down arrow or pgdn keys to scroll down a bit 5. Exit less and scroll up # Expected behavior Scrolling up shows input and output from previous terminal commands. # Actual behavior Scrolling up shows the lines that were viewed in less and overwrites the previous output. ![wt_issue](https://user-images.githubusercontent.com/31864869/78043654-9c441f00-7341-11ea-8d70-d7e55e9b4656.gif) **This may be a duplicate of: https://github.com/microsoft/terminal/issues/3492**
claunia added the Resolution-Duplicate label 2026-01-31 00:58:33 +00:00
Author
Owner

@lvfrazao commented on GitHub (Mar 31, 2020):

Slightly more info, this happens with less, but not with vim or nano.

Would appreciate any known workarounds as this makes working in the terminal rather difficult as I basically lose the ability to review previous output anytime I use less.

@lvfrazao commented on GitHub (Mar 31, 2020): Slightly more info, this happens with `less`, but not with `vim` or `nano`. Would appreciate any known workarounds as this makes working in the terminal rather difficult as I basically lose the ability to review previous output anytime I use less.
Author
Owner

@zadjii-msft commented on GitHub (Mar 31, 2020):

Thanks for the report! This is actually already being tracked by another issue on our repo - please refer to #4676 for more discussion.

/dup #4676

(Apparently that one's actually a dupe of the root cause over in #381)

@zadjii-msft commented on GitHub (Mar 31, 2020): Thanks for the report! This is actually already being tracked by another issue on our repo - please refer to #4676 for more discussion. /dup #4676 (Apparently that one's actually a dupe of the root cause over in #381)
Author
Owner

@ghost commented on GitHub (Mar 31, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Mar 31, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7233