Table of Contents

Class LegacyConsoleBackend

Namespace
MiniTui
Assembly
MiniTui.dll

Fallback backend for consoles without VT support (§5.6), using the Console API. Limited to 16 colors; no alternate screen or synchronized output. Reversed is emulated by swapping colors; other modifiers aren't shown.

public sealed class LegacyConsoleBackend : ITerminalBackend, IDisposable
Inheritance
LegacyConsoleBackend
Implements
Inherited Members

Constructors

LegacyConsoleBackend(ColorMode)

Create a legacy backend. The color mode is capped at Ansi16.

public LegacyConsoleBackend(ColorMode colorMode = ColorMode.Ansi16)

Parameters

colorMode ColorMode

Properties

ColorMode

The color mode colors are downsampled to.

public ColorMode ColorMode { get; }

Property Value

ColorMode

Methods

Dispose()

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

public void Dispose()

Draw(IReadOnlyList<CellUpdate>, (int X, int Y)?, bool)

Draw changed cells. Continuation cells are never included: a wide cell covers the cell to its right.

public void Draw(IReadOnlyList<CellUpdate> updates, (int X, int Y)? cursor, bool fullRedraw)

Parameters

updates IReadOnlyList<CellUpdate>

The changed cells.

cursor (int X, int Y)?

Where to show the cursor, or null to hide it.

fullRedraw bool

Clear the screen first; updates then contains every cell.

Enter()

Put the terminal into TUI mode (alternate screen, hidden cursor, ...). Idempotent.

public void Enter()

Exceptions

TerminalNotSupportedException

stdin or stdout is redirected.

GetSize()

The current terminal size in cells.

public (int Width, int Height) GetSize()

Returns

(int Width, int Height)

Leave()

Restore the terminal to how it was before Enter(). Idempotent and never throws.

public void Leave()