TaskbarProgress
ConsoleMonster.Output
Drives the terminal's progress indicator with OSC 9;4: in Windows Terminal the tab and the taskbar button show a percentage, an error, warnings or indeterminate work. Live sessions, Show-ConsoleStatusLine and Terminal.Status drive it automatically, and it is cleared when they end, on Ctrl+C and on process exit. It is only written to terminals known to show it (Windows Terminal, ConEmu), never in CI, redirected or plain output, and CONSOLEMONSTER_TASKBAR=0 or TaskbarProgress.Enabled turns it off.
Inheritance
- object
- TaskbarProgress
Methods
public static void Bell() #Rings the terminal bell (BEL) on the console, for a finished run; not in CI or redirected output.
public static TaskbarState Combine(IEnumerable<KeyValuePair<TaskbarState, double>> sources, out int percent) #Combines contributions: an error wins, then warnings, then a percentage (the average of those that have one), then indeterminate work.
Parameters
- sources System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<ConsoleMonster.Output.TaskbarState, double>>
- The contributions.
- percent int
- The combined percentage.
public static bool IsSupported(TerminalProfile profile) #Whether a terminal shows the indicator: Windows Terminal (or ConEmu), interactive VT output, not CI, not redirected.
Parameters
- profile ConsoleMonster.Capabilities.TerminalProfile
- The profile.
Returns
bool True when the sequence may be written.public static string Sequence(TaskbarState state, int percent) #The escape sequence for a state: ESC ] 9 ; 4 ; state ; percent BEL.
Parameters
- state ConsoleMonster.Output.TaskbarState
- The state.
- percent int
- The percentage, 0 to 100 (ignored for Clear and Indeterminate).
Returns
string The sequence.public static void Set(TaskbarState state, int percent = 0) #Shows a state on the console when it shows the indicator; repeated states are not written again.
Parameters
- state ConsoleMonster.Output.TaskbarState
- The state.
- percent int = 0
- The percentage, 0 to 100.
Inherited Methods
Properties
public static bool Enabled { get; set; } #Whether the indicator may be used at all (default true; CONSOLEMONSTER_TASKBAR=0 turns it off).