Skip to content

Hex1bTerminalSnapshot

Namespace: Hex1b.Automation

Assembly: Hex1b.dll

An immutable snapshot of terminal state at a point in time. Used for assertions and wait conditions in test sequences.

csharp
public sealed class Hex1bTerminalSnapshot : IHex1bTerminalRegion, IDisposable

Inheritance

ObjectHex1bTerminalSnapshot

Implements

Properties

CellPixelHeight

Height of a terminal character cell in pixels.

Returns: Int32

csharp
public int CellPixelHeight { get; }

CellPixelWidth

Width of a terminal character cell in pixels.

Returns: Int32

csharp
public int CellPixelWidth { get; }

CursorX

Cursor X position at snapshot time.

Returns: Int32

csharp
public int CursorX { get; }

CursorY

Cursor Y position at snapshot time.

Returns: Int32

csharp
public int CursorY { get; }

Height

Terminal height at snapshot time.

Returns: Int32

csharp
public int Height { get; }

InAlternateScreen

Whether the terminal was in alternate screen mode at snapshot time.

Returns: Boolean

csharp
public bool InAlternateScreen { get; }

KgpImages

KGP image data referenced by placements, keyed by image ID.

Returns: IReadOnlyDictionary<UInt32, KgpImageData>

csharp
public IReadOnlyDictionary<uint, KgpImageData> KgpImages { get; }

KgpPlacements

KGP image placements active at snapshot time.

Returns: IReadOnlyList<KgpPlacement>

csharp
public IReadOnlyList<KgpPlacement> KgpPlacements { get; }

ScrollbackLineCount

Number of scrollback lines included in this snapshot (prepended above visible content).

Returns: Int32

csharp
public int ScrollbackLineCount { get; }

Terminal

Reference to the live terminal (for advanced scenarios).

Returns: Hex1bTerminal

csharp
public Hex1bTerminal Terminal { get; }

Timestamp

When the snapshot was taken.

Returns: DateTimeOffset

csharp
public DateTimeOffset Timestamp { get; }

Width

Terminal width at snapshot time.

Returns: Int32

csharp
public int Width { get; }

Methods

ContainsSixelData()

Checks if any cell in the snapshot contains Sixel data.

Returns: Boolean

csharp
public bool ContainsSixelData()

Dispose()

Releases tracked object references held by this snapshot.

csharp
public void Dispose()

GetCell(int, int)

Gets the cell at the specified position within this region.

Parameters:

  • x (Int32): X coordinate (0 to Width-1).
  • y (Int32): Y coordinate (0 to Height-1).

Returns: TerminalCell

The terminal cell, or if out of bounds.

csharp
public TerminalCell GetCell(int x, int y)

GetRegion(Rect)

Gets a sub-region with localized coordinates.

Parameters:

  • bounds (Rect): The bounds of the region to extract, relative to this region.

Returns: Hex1bTerminalSnapshotRegion

A region view that translates local coordinates.

csharp
public Hex1bTerminalSnapshotRegion GetRegion(Rect bounds)

GetScreenText()

Gets the full screen text with all lines separated by newlines.

Returns: String

csharp
public string GetScreenText()

Released under the MIT License.