Table of Contents

Class ProgressBar

Namespace
Retro.Crt
Assembly
Retro.Crt.dll

Single-line progress bar that redraws in place via carriage return. Use once via using var bar = ProgressBar.Start(total); — disposing finishes the bar (full fill + newline).

public sealed class ProgressBar : IDisposable
Inheritance
ProgressBar
Implements
Inherited Members

Properties

Total

public long Total { get; }

Property Value

long

Value

public long Value { get; }

Property Value

long

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Set(long)

public void Set(long value)

Parameters

value long

Start(long, int, string?, Color?, bool)

Begin a new progress bar and render the empty frame.

public static ProgressBar Start(long total, int width = 30, string? label = null, Color? color = null, bool showPercent = true)

Parameters

total long

Total work units the bar represents (≥1).

width int

Bar cells. Defaults to 30. Pass FillWidth to span the terminal — the bar sizes itself to the available space after subtracting the label and percent suffix. Clamped to [1, ProgressBarRenderer.MaxWidth].

label string

Optional text written before the bar, with a single trailing space. Falls back to no label when null.

color Color?

Optional foreground for the bar fill. When null, falls back to the active theme's accent slot, or no color if no theme is active.

showPercent bool

Append a 5-character percent suffix (" ddd%") to every frame. Defaults to true.

Returns

ProgressBar

Tick(long)

public void Tick(long delta = 1)

Parameters

delta long