winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Use native PowerShell progress bar instead of ugly shell simulated progress bar

Open soroshsabz opened this issue 3 years ago • 16 comments

Description of the new feature/enhancement

Replace PowerShell progress bar instead of ugly shell based progress simulated when we try download to install package in PowerShell with winget

I think it is good to replace below

image

with

image

Proposed technical implementation details (optional)

I suggest using write-progress command when using winget in PowerShell to make better user experience in PowerShell eco-system and feel in-house and native command in PowerShell

This blog is very helpful for writing progress bar in powershell, and this progress can easily show percentage, bytes remaining and speed( this is very needed for downloading from internet with limited speed)

soroshsabz avatar Sep 03 '21 06:09 soroshsabz

related to #221

related to #674

related to #1088

soroshsabz avatar Sep 03 '21 06:09 soroshsabz

This needs to be user configurable. The PowerShell progress bar (at least in 5.1) is buggy as heck whenever I try to use it, so most of the time I suppress it. The winget progress bar works fine, on the other hand.

jedieaston avatar Sep 03 '21 15:09 jedieaston

This would be configurable just like "rainbow", "retro", etc.

denelon avatar Sep 03 '21 15:09 denelon

For what it's worth the PowerShell-native progress bar has been changed to look pretty similar to the current one winget presents in PowerShell 7.2

I personally don't think this is a pressing issue as progress bars are a UI feature for interactive users (humans) and that's not really how I'm going to use winget - but if it's not too much work, sure.

jantari avatar Sep 15 '21 18:09 jantari

@jantari I think it is important to Microsoft ecosystem is being consistent, so I think all Microsoft CLI app must be used native PowerShell progress bar if the app need progress bar, to achieve same UX in Microsoft ecosystem.

https://it-overload.com/2021/03/02/the-beauty-of-progress-bar-in-powershell-7-2-preview-3/

as you can see, and as you can say, if we are using native PowerShell progress bar we can achieve all benefit of working in PowerShell Core. if some day PowerShell team decide to change progress bar and make it better than now, winget can take all the benefit of PowerShell facilities without paying any cost.

thanks

soroshsabz avatar Sep 16 '21 05:09 soroshsabz

What about for those us that don't use PowerShell though? Keep this is a fallback?

VivaLosDoyers avatar Sep 22 '21 18:09 VivaLosDoyers

For those of us who think the default PowerShell progress bar is ugly, we can at least improve the colors by putting something like this in ~/Documents/WindowsPowerShell/profile.ps1

$Host.PrivateData.ProgressForegroundColor='White'
$Host.PrivateData.ProgressBackgroundColor='Blue'

I still strongly favor the winget progress bar, especially since it provides additional useful information: 486 MB / 510 MB in the example.

rdeforest avatar Sep 30 '21 20:09 rdeforest

  1. https://github.com/microsoft/winget-cli/issues/1429#issuecomment-931639466 and
  2. https://github.com/microsoft/winget-cli/issues/1429#issuecomment-912611004

@rdeforest, if that is problematic for you, report that to the maintainers of PowerShell, because if those problems are remediated, the applications shall gain consistent indicators of progress.

RokeJulianLockhart avatar Oct 04 '21 21:10 RokeJulianLockhart

It's a problem in PowerShell 5.1, as far as I can tell it's fine (or at least, better) in PowerShell 7. I don't think PowerShell 5.1 is being supported for anything other than emergency bug fixes, or else I would (although I'm sure they're aware of it).

jedieaston avatar Oct 04 '21 21:10 jedieaston

http://github.com/microsoft/winget-cli/issues/1429#issuecomment-931639466, and http://github.com/microsoft/winget-cli/issues/1429#issuecomment-912611004.

If that is problematic for you, report that to the maintainers of PowerShell, because if those problems are remediated, this software shall gain consistent indicators of progress, and PowerShell's shall have been improved.

Yes, improving PowerShell is a great idea, but this issue #1429 is about the winget-cli project. Improving the PS progress bar is out of scope.

When there is no feature gap between the progress bars in winget and PowerShell then this issue will have some legs. Until then it should be maximally de-prioritized in favor of work which will make winget better.

I don't speak for the winget-cli team, I'm just a person on the Internet with opinions.

rdeforest avatar Oct 04 '21 23:10 rdeforest

Oh, definitely fix the actual issues first

Masamune3210 avatar Oct 05 '21 02:10 Masamune3210

Ihmo it looks prettier in Microsoft Terminal and PowerShell 7.x

Karl-WE avatar Dec 30 '22 21:12 Karl-WE

Just feedback from a regular user here, but I'd much prefer a mix of both, but more so a PowerShell 7.x styled one but in Gray or B/W.

Spacellary avatar Feb 24 '23 10:02 Spacellary

https://github.com/microsoft/winget-cli/issues/1429#issuecomment-1443430771

@Spacellary, I believe that Write-Progress accepts colouration parameters, although I admit that I don't see any reference to this at https://github.com/MicrosoftDocs/PowerShell-Docs/blob/86925ef514369544b5b6e6502172c81f66c09126/reference/7.4/Microsoft.PowerShell.Utility/Write-Progress.md#parameters.

RokeJulianLockhart avatar Mar 02 '23 12:03 RokeJulianLockhart

Add this to your settings.json config file for Winget to get a nice rainbow version

"visual": {
        "progressBar": "rainbow",

image

davidldennison avatar May 10 '24 20:05 davidldennison

@soroshsabz is this still something you pursue or is the one from @davidldennison plus the Windows Terminal View in PowerShell 7.x enough? Thank you for considering housekeeping and close if no longer requested.

Karl-WE avatar May 10 '24 23:05 Karl-WE

As @RokeJulianLockhart said, I think winget-cli can implement progress bar with native PowerShell progress bar feature and I think it is very odd to winget-cli does not support native PowerShell Progress Bar

soroshsabz avatar May 13 '24 22:05 soroshsabz

Integration, Consistency and Ecosystem driven is keys of Major Software Company for way of success

soroshsabz avatar May 13 '24 22:05 soroshsabz

I see your point clearer now. Can just believe they do not want to use PowerShell progress bar to reduce dependencies. imagine that something in progress bar commandlet changes, and this would break winget.

As PS is not maintained by winget team, you might understand the complexity. In addition, PS 5.1, 7 or later might have different syntax. this is usually the case for other commands as well. Not speaking for winget team at all, just bringing up my thoughts why they might have chosen this way. When winget has been released, it had no PowerShell support. +1 for consistency :)

Karl-WE avatar May 14 '24 00:05 Karl-WE