flexible handling of GetConsoleWidth method's default value would be useful in scripting #1300
Labels
Area-Output
Issue related to CLI output
Issue-Feature
This is a feature request for the Windows Package Manager client.
Description of the new feature/enhancement
When listing output
winget
truncates column width(s) to accommodate for the total width of the console, which is determined by a call toGetConsoleWidth
insrc\AppInstallerCLICore\TableOutput.h
If the console is not wide enough, output of a column is truncated and a UTF8 Horizontal Ellipsis (…) is append to the end of the column, also in
src\AppInstallerCLICore\TableOutput.h
; see the first listing in the image below.When the console is wide enough, all of the columns are output in their entirety; see the second listing in the image below.
However, if you either pipe the output to a subsequent command, such as
winget upgrade | Select-Object -skip 3
, or you assign it to a variable,GetConsoleWidth
uses a hard coded120
for the console width, because it can't get console buffer info for std out. Besides being truncated, the output is also garbled because it is not captured as UTF8; ; see the third listing in the image below.Proposed technical implementation details (optional)
Adding native PowerShell support as proposed in #221 would be the ideal solution, however a quick simple patch to bump up the default value to 180+ would be great in the mean time.
The text was updated successfully, but these errors were encountered: