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 ​

Object → Hex1bTerminalSnapshot

Implements ​

Properties ​

ApplicationCursorKeysEnabled ​

Whether application-cursor-keys mode (DECCKM, DEC mode 1) was enabled at snapshot time.

Returns: Boolean

csharp
public bool ApplicationCursorKeysEnabled { get; }

ApplicationKeypadEnabled ​

Whether application-keypad mode (DECKPAM, ESC =) was enabled at snapshot time.

Returns: Boolean

csharp
public bool ApplicationKeypadEnabled { get; }

BracketedPasteEnabled ​

Whether bracketed-paste mode (DEC mode 2004) was enabled at snapshot time.

Returns: Boolean

csharp
public bool BracketedPasteEnabled { get; }

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; }

CommandMarks ​

Gets the OSC 133 command-mark history captured atomically with this snapshot.

Returns: IReadOnlyList<TerminalCommandMark>

csharp
public IReadOnlyList<TerminalCommandMark> CommandMarks { get; }

CursorShape ​

DECSCUSR cursor shape value at snapshot time. 0 means "default"; values 1–6 follow the standard CSI Ps SP q mapping.

Returns: Int32

csharp
public int CursorShape { get; }

CursorVisible ​

Whether the cursor was visible (DECTCEM, DEC mode 25) at snapshot time.

Returns: Boolean

csharp
public bool CursorVisible { 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; }

FocusEventsEnabled ​

Whether focus-in/focus-out reporting (DEC mode 1004) was enabled at snapshot time.

Returns: Boolean

csharp
public bool FocusEventsEnabled { 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 the visible snapshot placements, keyed by image ID.

Returns: IReadOnlyDictionary<UInt32, KgpImageData>

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

KgpPlacements ​

KGP image placement fragments visible in this snapshot, including any requested scrollback rows.

Returns: IReadOnlyList<KgpPlacement>

csharp
public IReadOnlyList<KgpPlacement> KgpPlacements { get; }

MouseEncodingSgrEnabled ​

Whether SGR mouse encoding (DEC mode 1006) was enabled at snapshot time.

Returns: Boolean

csharp
public bool MouseEncodingSgrEnabled { get; }

MouseEncodingUrxvtEnabled ​

Whether urxvt mouse encoding (DEC mode 1015) was enabled at snapshot time.

Returns: Boolean

csharp
public bool MouseEncodingUrxvtEnabled { get; }

MouseEncodingUtf8Enabled ​

Whether UTF-8 mouse encoding (DEC mode 1005) was enabled at snapshot time.

Returns: Boolean

csharp
public bool MouseEncodingUtf8Enabled { get; }

MouseProtocolAnyEnabled ​

Whether any-event mouse tracking (DEC mode 1003) was enabled at snapshot time.

Returns: Boolean

csharp
public bool MouseProtocolAnyEnabled { get; }

MouseProtocolButtonEnabled ​

Whether button-event mouse tracking (DEC mode 1002) was enabled at snapshot time.

Returns: Boolean

csharp
public bool MouseProtocolButtonEnabled { get; }

MouseProtocolHighlightEnabled ​

Whether highlight mouse tracking (DEC mode 1001) was enabled at snapshot time.

Returns: Boolean

csharp
public bool MouseProtocolHighlightEnabled { get; }

MouseProtocolNormalEnabled ​

Whether X11 normal mouse tracking (DEC mode 1000) was enabled at snapshot time.

Returns: Boolean

csharp
public bool MouseProtocolNormalEnabled { get; }

MouseProtocolX10Enabled ​

Whether X10-compatibility mouse tracking (DEC mode 9) was enabled at snapshot time.

Returns: Boolean

csharp
public bool MouseProtocolX10Enabled { get; }

Progress ​

Gets the immutable progress state captured atomically with this snapshot.

Returns: TerminalProgress

csharp
public TerminalProgress Progress { get; }

ScrollbackLineCount ​

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

Returns: Int32

csharp
public int ScrollbackLineCount { get; }

ShellIntegration ​

Gets the immutable shell phase and latest result captured atomically with this snapshot.

Returns: TerminalShellIntegration

csharp
public TerminalShellIntegration ShellIntegration { get; }

SixelImages ​

Sixel image data referenced by the visible snapshot placements, keyed by immutable resource identity hash.

Returns: IReadOnlyDictionary<Byte[], SixelData>

csharp
public IReadOnlyDictionary<byte[], SixelData> SixelImages { get; }

SixelPlacements ​

Sixel placements visible in this snapshot, including any requested scrollback rows.

Returns: IReadOnlyList<SixelPlacement>

csharp
public IReadOnlyList<SixelPlacement> SixelPlacements { 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; }

WindowTitle ​

Gets the window title captured atomically with this snapshot.

Returns: String

csharp
public string WindowTitle { get; }

WorkingDirectory ​

Gets the working directory last reported by OSC 7, captured atomically with this snapshot.

Returns: TerminalWorkingDirectory

csharp
public TerminalWorkingDirectory WorkingDirectory { get; }

Methods ​

ContainsSixelData() ​

Checks if any placement in the snapshot paints at least one cell.

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.