question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$PSStyle.Progress.View = Minimal on some terminal types when there is output

See original GitHub issue

Prerequisites

Steps to reproduce

On 7.2 make sure you have PSStyle.Progress.View = set to minimal.

foreach ($i in  1..100) {if ($i % 20 -eq 0) {$i} else {sleep -Milliseconds 50}  Write-Progress "Checking" -PercentComplete $i } 

On (e.g) Windows terminal this works as I would expect, Multiples of 20 are output and the progress bar shifts below them I can output more than a screenful and the progress remains below my output, all good.

In (e.g) the PowerShell integrated console in VS code the moving progress bar leaves past versions behind and obscures the output

Expected behavior

See Screen shot 1

Actual behavior

See screen shot 2

Error details

n/a

Environment data

PSVersion                      7.2.0
PSEdition                      Core
GitCommitId                    7.2.0
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

1 After working correctly

image

2 Failing

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
SeeminglySciencecommented, Nov 15, 2021

Unsure if the original problem is related, but what @daxian-dbw describes is due to a missing piece in the host impl described here.

1reaction
andschwacommented, May 10, 2022

Awesome news, thanks @jhoneill!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using PowerShell with $PSStyle
If you need or prefer the legacy look, you can easily set that. $psstyle.Progress.view = "Classic". Use a value of 'Minimal' for the...
Read more >
Write-Progress (Microsoft.PowerShell.Utility)
The Write-Progress cmdlet displays a progress bar in a PowerShell command window that depicts the status of a running command or script.
Read more >
Styling your PowerShell terminal with $PSStyle - YouTube
In this video, we look at how to format your terminal with $ PSStyle. This video is part of my PowerShell training course....
Read more >
$PSStyle
OutputRendering = "ANSI" Write-Warning "Be careful!" Get-Process | Select-Object -First 5 $PSStyle.Progress.View = "Minimal" $PSStyle.Progress.
Read more >
7.2.md - PowerShell/PowerShell - Sourcegraph
Suppress Write-Progress in ConsoleHost if output is redirected and fix tests (#14716) · Experimental feature PSAnsiProgress : Add minimal ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found