feat: Add version diff highlighting to upgrade and list output#6281
feat: Add version diff highlighting to upgrade and list output#6281keanehatescoding wants to merge 1 commit into
Conversation
Colorize the changed suffix of version strings when displaying pending upgrades via `winget upgrade` and `winget list`. The common prefix of the installed and available version is rendered in the default color, while the diverging suffix is highlighted: bright red for the installed version and bright green for the available version. Highlighting is suppressed when VT is disabled (redirected output, --nowrap, or --no-vt), preserving clean machine-readable output.
Trenly
left a comment
There was a problem hiding this comment.
Test cases need to be added for this. It also should be opt-in as a user setting under the visual options as this had stong potential to break existing scripts relying on the raw output
There was a problem hiding this comment.
Please keep the existing formatting for the code.
Does it? I thought that we were able to detect when we were not running in a terminal and would produce the output as if we had --no-vt. |
Hmmm. That is true (granted it is a recent addition) - but is there not the possibility that someone takes un-ridrected output from the attached terminal? Either way, it seems like a strong case for a user setting - though that point may be moot since the head branch has been deleted, though I'm not sure why as I could imagine tests (and even a setting) would have been relatively straightforward to add compared to the other changes in the pr |
Colorize the changed suffix of version strings when displaying pending upgrades via
winget upgradeandwinget list. The common prefix of the installed and available version is rendered in the default color, while the diverging suffix is highlighted: bright red for the installed version and bright green for the available version.Highlighting is suppressed when VT is disabled (redirected output, --nowrap, or --no-vt), preserving clean machine-readable output.
📖 Description
🔗 References
🔍 Validation
✅ Checklist
📋 Issue Type
Microsoft Reviewers: Open in CodeFlow