forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Hackathon As part of a yearly event to work on personal choice projects, I implemented support for rendering [sixels](https://en.wikipedia.org/wiki/Sixel) in a few different scenarios. You can try it out in any terminal that supports sixels, such as the latest [Windows Terminal Preview build](https://github.com/microsoft/terminal/releases/tag/v1.22.2362.0). Both @lhecker and @j4james were very helpful with guidance on the nuances of sixels. ## Change The foundational work is a wrapper around the [Windows Imaging Component (WIC) APIs](https://learn.microsoft.com/en-us/windows/win32/api/_wic/) and a renderer for converting the indexed images to sixel format. WIC does all the heavy lifting of decoding images, palette optimization and dithering. My additions are a simple compositor and sixel renderer. There is also some new code for detecting VT extension support, including only enabling sixel rendering if the terminal advertises the extension. Sixel use was added in various ways. The winget icon is output any time the header would be (during `winget --info` and any time we output help): <img width="435" alt="winget-info" src="https://github.com/user-attachments/assets/7e6f8548-1c09-4108-aa5e-810bfeef6c4f"> The package icon (if present) is displayed during `winget show`. This is an example using a local manifest updated to point to an image located on the github repository of the package; actual package icon will likely be different. Package icons extracted from actual installs are expected to arrive soon: <img width="266" alt="winget-show" src="https://github.com/user-attachments/assets/fdbcf1fa-c2a3-4094-9415-4761702a44fa"> A new progress visualization is available using sixels. The indefinite progress (the current character spinner that iterates through various slashes, dash and pipe) looks like:  while the progress bar is a conveyor belt bringing your package to you:  _The conveyor belt base image is only the finest of dev art; it is very open to someone with more artistic skill to improve upon._ The tearing present in this gif does exist, but it is exaggerated by the capture and the slow steady progress. Actual progress is much less steady, making any tearing that may occur far less noticeable. ## Settings Use of sixels (including even the attempt to detect support in the terminal) is gated behind enabling them in the settings. Two new/updated settings are available. - `.visual.enableSixels` (`true` or `false`) - This controls the winget icon during help and the package icon during show. - `.visual.progressBar` - `"sixel"` causes progress to use the sixel versions shown above. - `"disabled"` disables progress output.
- Loading branch information
Showing
38 changed files
with
2,396 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,6 +302,8 @@ silentwithprogress | |
Silverlight | ||
simplesave | ||
simpletest | ||
sixel | ||
sixels | ||
sln | ||
sqlbuilder | ||
sqliteicu | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.