API Reference
TaskbarProgress
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, Write-ConsoleStatus 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() #VoidRings 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 Int32 percent) #TaskbarStateCombines 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, System.Double>>
- The contributions.
- percent System.Int32
- The combined percentage.
Returns
The combined state (Clear when nothing reports).
public static Boolean IsSupported(TerminalProfile profile) #BooleanWhether a terminal shows the indicator: Windows Terminal (or ConEmu), interactive VT output, not CI, not redirected.
Parameters
- profile ConsoleMonster.Capabilities.TerminalProfile
- The profile.
Returns
True when the sequence may be written.
public static String Sequence(TaskbarState state, Int32 percent) #StringThe escape sequence for a state: ESC ] 9 ; 4 ; state ; percent BEL.
Parameters
- state ConsoleMonster.Output.TaskbarState
- The state.
- percent System.Int32
- The percentage, 0 to 100 (ignored for Clear and Indeterminate).
Returns
The sequence.
public static Void Set(TaskbarState state, Int32 percent = 0) #VoidShows a state on the console when it shows the indicator; repeated states are not written again.
Parameters
- state ConsoleMonster.Output.TaskbarState
- The state.
- percent System.Int32 = 0
- The percentage, 0 to 100.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public static Boolean Enabled { get; set; } #Whether the indicator may be used at all (default true; CONSOLEMONSTER_TASKBAR=0 turns it off).