Less Pollutes Scrollback Buffer in WSL/Ubuntu #7232

Open
opened 2026-01-31 00:58:29 +00:00 by claunia · 0 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:29 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7232