❔ Using Windows Terminal progress bar in c#

How to make use of Windows Terminal progress bar (progress circle on tab next to tab's name), line WinGet does? I've tried searching through WinGet's source code but came up empty.
9 Replies
ero
ero2y ago
it's definitely not exclusive to winget benchmarkdotnet uses it too so you might want to look into powershell instead or just the terminal i guess https://github.com/PowerShell/PowerShell https://github.com/microsoft/terminal
krnlException
krnlExceptionOP2y ago
In a issue about that progress ring, I've found a string of characters to trigger it ^[]9;4;1;10^[\ Where 10 is progress
canton7
canton72y ago
GitHub
Feature Request: Taskbar progress indicator · Issue #3004 · microso...
Description of the new feature/enhancement Add a taskbar progress indicator for displaying the status of the current long running process (when possible). For example, this can be helpful to users ...
canton7
canton72y ago
(first google hit for "windows terminal progress indicator")
canton7
canton72y ago
GitHub
Add taskbar progress by timcassell · Pull Request #2158 · dotnet/Be...
I initially tried to use a nuget package, but it does not support netstandard2.0. So I copied the relevant code from https://github.com/contre/Windows-API-Code-Pack-1.1 to Helpers/Taskbar to get th...
Buddy
Buddy2y ago
Definitely takes use of ANSI escape sequence this means 10% https://github.com/dotnet/BenchmarkDotNet/pull/2158/files#diff-ada7ae88864325b6a0d06cfc63729b11deaa0a9090fa4153c761d96a4318956fR192 Thanks to canton7 for linking towards it
Console.Write($"\x1b]9;4;1;{value}\x1b\\");
Console.Write($"\x1b]9;4;1;{value}\x1b\\");
https://github.com/dotnet/BenchmarkDotNet/pull/2158/files#diff-ada7ae88864325b6a0d06cfc63729b11deaa0a9090fa4153c761d96a4318956fR151-R168 Here also handles the state of the progress
krnlException
krnlExceptionOP2y ago
Thanks, imo this should be documented in some way
reflectronic
reflectronic2y ago
it is this is a standard that most terminal applications follow
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server