Clear-Host fails to clear the first line #7032

Open
opened 2026-01-31 00:53:22 +00:00 by claunia · 0 comments
Owner

Originally created by @brantburnett on GitHub (Mar 20, 2020).

Originally assigned to: @zadjii-msft on GitHub.

Environment

Windows build number: 10.0.19041.0
Windows Terminal version: 0.10.761.0

Any other software?
PowerShell Core 7.0.0
NodeJS 12.16.1
coronavirus-tracker-cli 0.6.0 (`npm install -g coronavirus-tracker-cli@0.6.0`)

Steps to reproduce

  1. Open PowerShell Core
  2. Run corona to get output
  3. Run cls to clear the screen

Expected behavior

Screen should be fully cleared.

Actual behavior

The first line retains some characters. This is probably related to the color formatting being used by the CLI. The characters retained are also not from the line that was originally the topmost line.

Output before clearing:
2020-03-20_10-59-23

Output after clearing:
2020-03-20_10-59-07

Note: A second cls finishes clearing the screen.

Originally created by @brantburnett on GitHub (Mar 20, 2020). Originally assigned to: @zadjii-msft on GitHub. # Environment ```none Windows build number: 10.0.19041.0 Windows Terminal version: 0.10.761.0 Any other software? PowerShell Core 7.0.0 NodeJS 12.16.1 coronavirus-tracker-cli 0.6.0 (`npm install -g coronavirus-tracker-cli@0.6.0`) ``` # Steps to reproduce 1. Open PowerShell Core 2. Run `corona` to get output 3. Run `cls` to clear the screen # Expected behavior Screen should be fully cleared. # Actual behavior The first line retains some characters. This is probably related to the color formatting being used by the CLI. The characters retained are also not from the line that was originally the topmost line. Output before clearing: ![2020-03-20_10-59-23](https://user-images.githubusercontent.com/7118719/77176046-e273c580-6a99-11ea-830d-93b00aa23c6b.png) Output after clearing: ![2020-03-20_10-59-07](https://user-images.githubusercontent.com/7118719/77176055-e56eb600-6a99-11ea-8aff-e216c8f4bbe5.png) Note: A second `cls` finishes clearing the screen.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7032