`winget search` output displays incomplete id when id is long
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
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?
The problem still exists in v1.9.25200. How can you expect winget to be used if the package ID is mangled?
Name ID Version Verfügbar Quelle
-----------------------------------------------------------------------------------------------------------------------
Microsoft .NET Framework 4.5 SDK Microsoft.DotNet.Framework.DeveloperPa… < 4.6.2 4.6.2 winget
I'm having the same problem. I tried the following:
winget search asp | Select-Object -Property Id
But got an Id header and an empty table.
Id
--
My workaround doesn't work in all cases, but worked in mine: Make the terminal wider.