microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.95k stars 1.43k forks source link

Package names are being truncated when searching with empty string #2603

Open fernandog opened 1 year ago

fernandog commented 1 year ago

Brief description of your issue

Package name are being truncated (notice the "..." ) when you do a search with empty string: winget search " "

image

This issue doesn't happen when you search by part of the name winget search visualstudio

image

Using Powershell x86 with maximized window on both commands

Steps to reproduce

search with empty string: winget search " "

Expected behavior

No truncated package names

Actual behavior

Package names are being truncated

Environment

PS C:\WINDOWS\system32> winget --version
v1.3.2691

Windows 11 22H2
denelon commented 1 year ago

The output is truncated to fit the terminal width in the CLI. We've got PowerShell modules and cmdlets coming out in the next release which don't truncate the output.

dong-lufei commented 1 year ago

https://github.com/microsoft/winget-cli/issues/2842

I didn't search for empty characters or app names with spaces, the command I used was winget list (and viewed at full screen size). In the displayed list of downloaded and installed application results, some application names or IDs are truncated and cannot be viewed completely

Frxhb commented 1 year ago

The output is truncated to fit the terminal width in the CLI. We've got PowerShell modules and cmdlets coming out in the next release which don't truncate the output.

is there a plan when this will be released? I joined the Windows Package Manager Insiders Program but It didnt change. Or wasnt it changed yet? Thanks alot.

denelon commented 1 year ago

A preview version of the PowerShell cmdlets is available via the GitHub release.

Frxhb commented 1 year ago

A preview version of the PowerShell cmdlets is available via the GitHub release.

Thanks, I have installed it. Can you tell me how to format the output of winget search """"now better?

denelon commented 1 year ago

Once the module is available, you can just run Find-WinGetPackage and pull the output you need. The default display in the terminal will still show truncated values, but the object contains the names.

Trenly commented 1 year ago

[Policy] Area-Output

RockstarSven commented 1 year ago

A workaround could be to output the results to file, and then review the file:

The default is truncated:

PS> winget list Microsoft.VisualStudio.2019
Name                                Id                                    Version  Available Source
---------------------------------------------------------------------------------------------------
Visual Studio Build Tools 2019      Microsoft.VisualStudio.2019.BuildToo… 16.11.28 16.11.29  winget

I use:

PS> winget list Microsoft.VisualStudio.2019 > foo.txt
PS> cat .\foo.txt

Name                                Id                                       Version  Available Source
------------------------------------------------------------------------------------------------------
Visual Studio Build Tools 2019      Microsoft.VisualStudio.2019.BuildTools   16.11.28 16.11.29  winget
schittli commented 1 month ago

microsoft winget-cli is a shame: M$ Customers pays billions every month and after many years, M$$ still has no useful package manager and M$ is not even motivated to offer basic and trivial features like returning the data as JSON??

denelon commented 1 month ago

You can use the Microsoft.WinGet.Client PowerShell module and Find-WinGetPackage "" using PowerShell.