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
23.17k stars 1.44k forks source link

`winget search` output displays incomplete id when id is long #3986

Open brkerez opened 10 months ago

brkerez commented 10 months ago

Brief description of your issue

Output of winget search is cutting the id if it is longer and I think this wasn't the case before 1.7.3172 (I'm not completely sure about the version it appeared but I think that it was displaying full ids in the past).

When you search for a package you then most likely want to copy the id to use it to upgrade/install/... so shortening ids is bad idea IMHO.

Here is the example of winget search terminal output:

 ⚡@pavel λ winget search terminal
Name                                         Id                         Version                 Match             Source
-------------------------------------------------------------------------------------------------------------------------

Windows Terminal                             Microsoft.WindowsTerminal  1.18.3181.0             Moniker: terminal winget
Stanlys_Terminal                             Xanthus58.Stanlys_Terminal 1.0.0                                     winget
Texnomic SecureDNS Terminal                  Texnomic.SecureDNS-Termin… 0.3                                       winget
Terminals                                    Terminals.Terminals        4.0.1.0                                   winget
OpenBB Terminal                              OpenBB-finance.OpenBBTerm… 3.1.0                                     winget
Windows Terminal Preview                     Microsoft.WindowsTerminal… 1.19.3172.0                               winget

The output of winget list terminal is behaving ok - displaying full ids:

⚡@pavel λ winget list terminal
Name                           Id                                       Version     Available Source
----------------------------------------------------------------------------------------------------
Windows Terminal               Microsoft.WindowsTerminal                1.18.3181.0           winget
Oh My Posh version 18.26.1     JanDeDobbeleer.OhMyPosh                  18.26.1     19.2.1    winget
gsudo v2.4.1-fixnoninteractive gerardog.gsudo                           2.4.1                 winget
Tabby 1.0.200                  Eugeny.Tabby                             1.0.200     1.0.205   winget
Alacritty                      Alacritty.Alacritty                      0.12.2                winget
FileBot                        PointPlanck.FileBot                      5.1.2                 winget
Chafa                          hpjansson.Chafa                          1.12.4      1.12.5    winget
duf                            muesli.duf                               0.8.1                 winget
bottom                         Clement.bottom                           0.9.6                 winget
Fluent Terminal                53621FSApps.FluentTerminal_ce3nnjsf22cn4 0.7.7.0
Windows Terminal Preview       Microsoft.WindowsTerminal.Preview        1.19.3172.0           winget
lazygit                        JesseDuffield.lazygit                    0.40.2                winget
micro                          zyedidia.micro                           2.0.11      2.0.13    winget

Steps to reproduce

winget search terminal

Expected behavior

The lenght of the id column in winget search output should be determined by longest id value in displayed list - as it is the case for winget list

Actual behavior

it seems that longer ids like Windows.Terminal.Preview are shortened to some artificial constant length (and comparing winget search and winget list output I think same applies for the name but there is some longer constant length if I'm not mistaken

Environment

⚡@pavel λ winget --info
Windows Package Manager (Preview) v1.7.3172-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.2861
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.3172.0
VeezyLife commented 3 months ago

I constantly have problems with this and can never find any option to display the full ID, name or version. Every time I run winget list I have at least a dozen where either the name , ID, or version is cut short thus rendering the entire command useless for what I needed it for. Bad design really, not well thought. Logically I thought --verbose may fix it but did nothing. Was this fixed?