Skip to content
ConsoleMonster
Class

VtOutputNormalizer

ConsoleMonster.Sessions

Namespace
ConsoleMonster.Sessions
Assembly
ConsoleMonster
Modifiers
sealed

Opt-in canonical encoding of terminal output without changing its visible cells or repaint boundaries. Removes window titles, cursor visibility/focus/input-mode housekeeping and cursor queries, combines supported SGR changes, and re-encodes equivalent cursor movement and already-blank writes through the shared terminal model. Latent blank styles, real scrolling, holds, synchronized updates and OSC hyperlinks remain effective. Unknown SGR is rejected rather than silently discarded. Unmodeled controls suspend optimization until reset; transport is then retained verbatim. A pending state that cannot safely be reconstructed is rejected.

Inheritance

  • object
  • VtOutputNormalizer

Constructors

public VtOutputNormalizer(int width, int height) #

Creates a normalizer with the recorded terminal's fixed geometry.

Parameters

width int required
Terminal columns.
height int required
Terminal rows.

Methods

public string Normalize(string text, bool textLineEndings = false) #

Normalizes a complete VT segment. Successive calls retain the active SGR state. Segments must end outside escape sequences. Set textLineEndings only for append-only text output whose LF means a new line; ordinary VT LF retains its column.

Parameters

text string required
Actual recorded output, including complete terminal controls.
textLineEndings bool = false optional
Whether bare LF is a text newline and should become CRLF.

Returns

string Canonical VT, with real text, measurements, geometry and frame boundaries preserved.