Skip to content

ReflowContext

Namespace: Hex1b.Reflow

Assembly: Hex1b.dll

Context passed to containing the terminal's current state before resize.

csharp
public readonly record struct ReflowContext : IEquatable<ReflowContext>

Implements

Constructors

ReflowContext(TerminalCell[][], ReflowScrollbackRow[], int, int, int, int, int, int, bool, int?, int?)

Context passed to containing the terminal's current state before resize.

Parameters:

  • ScreenRows (TerminalCell[][]): The current screen buffer rows, each as a array. Ordered top to bottom (index 0 is the top row).
  • ScrollbackRows (ReflowScrollbackRow[]): Scrollback buffer rows ordered oldest to newest. Empty if scrollback is not enabled or is empty.
  • OldWidth (Int32): The terminal width before resize.
  • OldHeight (Int32): The terminal height before resize.
  • NewWidth (Int32): The terminal width after resize.
  • NewHeight (Int32): The terminal height after resize.
  • CursorX (Int32): The cursor column position (0-based) before resize.
  • CursorY (Int32): The cursor row position (0-based) before resize.
  • InAlternateScreen (Boolean): Whether the terminal is currently in the alternate screen buffer.
  • SavedCursorX (Nullable<Int32>): The DECSC saved cursor column position, or null if no cursor has been saved.
  • SavedCursorY (Nullable<Int32>): The DECSC saved cursor row position, or null if no cursor has been saved.
csharp
public ReflowContext(TerminalCell[][] ScreenRows, ReflowScrollbackRow[] ScrollbackRows, int OldWidth, int OldHeight, int NewWidth, int NewHeight, int CursorX, int CursorY, bool InAlternateScreen, int? SavedCursorX = null, int? SavedCursorY = null)

Properties

CursorX

The cursor column position (0-based) before resize.

Returns: Int32

csharp
public int CursorX { get; init; }

CursorY

The cursor row position (0-based) before resize.

Returns: Int32

csharp
public int CursorY { get; init; }

InAlternateScreen

Whether the terminal is currently in the alternate screen buffer.

Returns: Boolean

csharp
public bool InAlternateScreen { get; init; }

NewHeight

The terminal height after resize.

Returns: Int32

csharp
public int NewHeight { get; init; }

NewWidth

The terminal width after resize.

Returns: Int32

csharp
public int NewWidth { get; init; }

OldHeight

The terminal height before resize.

Returns: Int32

csharp
public int OldHeight { get; init; }

OldWidth

The terminal width before resize.

Returns: Int32

csharp
public int OldWidth { get; init; }

SavedCursorX

The DECSC saved cursor column position, or null if no cursor has been saved.

Returns: Nullable<Int32>

csharp
public int? SavedCursorX { get; init; }

SavedCursorY

The DECSC saved cursor row position, or null if no cursor has been saved.

Returns: Nullable<Int32>

csharp
public int? SavedCursorY { get; init; }

ScreenRows

The current screen buffer rows, each as a array. Ordered top to bottom (index 0 is the top row).

Returns: TerminalCell[][]

csharp
public TerminalCell[][] ScreenRows { get; init; }

ScrollbackRows

Scrollback buffer rows ordered oldest to newest. Empty if scrollback is not enabled or is empty.

Returns: ReflowScrollbackRow[]

csharp
public ReflowScrollbackRow[] ScrollbackRows { get; init; }

Released under the MIT License.