TerminalCell
Namespace: Hex1b
Assembly: Hex1b.dll
Represents a single cell in the virtual terminal screen buffer.
public readonly record struct TerminalCell : IEquatable<TerminalCell>Implements
Constructors
TerminalCell(string, Hex1bColor?, Hex1bColor?, CellAttributes, long, DateTimeOffset, TrackedObject<HyperlinkData>?, Hex1bColor?, UnderlineStyle)
Represents a single cell in the virtual terminal screen buffer.
Parameters:
Character(String): The grapheme cluster (user-perceived character) displayed in this cell. May be multiple code points for emoji, combining characters, etc.Foreground(Nullable<Hex1bColor>): The foreground color, or null for default.Background(Nullable<Hex1bColor>): The background color, or null for default.Attributes(CellAttributes): Text styling attributes (bold, italic, etc.).Sequence(Int64): The write order of this cell. Higher values were written later. Used for z-ordering during rendering.WrittenAt(DateTimeOffset): The timestamp when this cell was written. Useful for debugging and future animation features.TrackedHyperlink(TrackedObject<HyperlinkData>): Optional tracked reference to hyperlink data associated with this cell.UnderlineColor(Nullable<Hex1bColor>): The underline color (SGR 58), or null to use the foreground color.UnderlineStyle(UnderlineStyle): The underline style (SGR 4:x). Defaults to .
public TerminalCell(string Character, Hex1bColor? Foreground, Hex1bColor? Background, CellAttributes Attributes = CellAttributes.None, long Sequence = 0, DateTimeOffset WrittenAt = default, TrackedObject<HyperlinkData>? TrackedHyperlink = null, Hex1bColor? UnderlineColor = null, UnderlineStyle UnderlineStyle = UnderlineStyle.None)Properties
Attributes
Text styling attributes (bold, italic, etc.).
Returns: CellAttributes
public CellAttributes Attributes { get; init; }Background
The background color, or null for default.
Returns: Nullable<Hex1bColor>
public Hex1bColor? Background { get; init; }Character
The grapheme cluster (user-perceived character) displayed in this cell. May be multiple code points for emoji, combining characters, etc.
Returns: String
public string Character { get; init; }Foreground
The foreground color, or null for default.
Returns: Nullable<Hex1bColor>
public Hex1bColor? Foreground { get; init; }HasHyperlinkData
Gets whether this cell has associated hyperlink data.
Returns: Boolean
public bool HasHyperlinkData { get; }HyperlinkData
Gets the hyperlink data if this cell has any, otherwise null.
Returns: HyperlinkData
public HyperlinkData? HyperlinkData { get; }IsBlink
Gets whether this cell has blinking text.
Returns: Boolean
public bool IsBlink { get; }IsBold
Gets whether this cell has bold text.
Returns: Boolean
public bool IsBold { get; }IsDim
Gets whether this cell has dim/faint text.
Returns: Boolean
public bool IsDim { get; }IsHidden
Gets whether this cell has hidden/invisible text.
Returns: Boolean
public bool IsHidden { get; }IsItalic
Gets whether this cell has italic text.
Returns: Boolean
public bool IsItalic { get; }IsOverline
Gets whether this cell has overlined text.
Returns: Boolean
public bool IsOverline { get; }IsReverse
Gets whether this cell has reverse video (inverted colors).
Returns: Boolean
public bool IsReverse { get; }IsSoftWrap
Gets whether this cell is a soft-wrap point (content continues on the next row).
Returns: Boolean
public bool IsSoftWrap { get; }IsStrikethrough
Gets whether this cell has strikethrough text.
Returns: Boolean
public bool IsStrikethrough { get; }IsUnderline
Gets whether this cell has underlined text.
Returns: Boolean
public bool IsUnderline { get; }Sequence
The write order of this cell. Higher values were written later. Used for z-ordering during rendering.
Returns: Int64
public long Sequence { get; init; }TrackedHyperlink
Optional tracked reference to hyperlink data associated with this cell.
Returns: TrackedObject<HyperlinkData>
public TrackedObject<HyperlinkData>? TrackedHyperlink { get; init; }UnderlineColor
The underline color (SGR 58), or null to use the foreground color.
Returns: Nullable<Hex1bColor>
public Hex1bColor? UnderlineColor { get; init; }UnderlineStyle
The underline style (SGR 4:x). Defaults to .
Returns: UnderlineStyle
public UnderlineStyle UnderlineStyle { get; init; }WrittenAt
The timestamp when this cell was written. Useful for debugging and future animation features.
Returns: DateTimeOffset
public DateTimeOffset WrittenAt { get; init; }Fields
Empty
An empty cell with default attributes.
Returns: TerminalCell
public static readonly TerminalCell EmptyRemarks
Sixel graphics are no longer owned by a cell. A cell that happens to sit under a Sixel placement carries no marker or reference at all; placement occupancy and image lifetime are tracked independently by the terminal's Sixel graphics state (see SixelGraphicsState) so overwriting a cell never has side effects on Sixel image lifetime.