Table of Contents

Struct TerminalSize

Namespace
Tmds.Ssh
Assembly
Tmds.Ssh.dll

Represents the size of a terminal.

public readonly struct TerminalSize : IEquatable<TerminalSize>
Implements
Inherited Members

Remarks

The size is expressed in characters (Columns and Rows) and, optionally, in pixels (WidthPixels and HeightPixels). Pixel dimensions can be 0 when unspecified.

Constructors

TerminalSize(int, int, int, int)

Initializes a new TerminalSize.

public TerminalSize(int columns, int rows, int widthPixels = 0, int heightPixels = 0)

Parameters

columns int

The terminal width in characters. Must be greater than 0.

rows int

The terminal height in characters. Must be greater than 0.

widthPixels int

The terminal width in pixels. Use 0 when unspecified. Must not be negative.

heightPixels int

The terminal height in pixels. Use 0 when unspecified. Must not be negative.

Properties

Columns

Gets the terminal width in characters.

public int Columns { get; }

Property Value

int

HeightPixels

Gets the terminal height in pixels.

public int HeightPixels { get; }

Property Value

int

Remarks

A value of 0 means the pixel height is unspecified.

Rows

Gets the terminal height in characters.

public int Rows { get; }

Property Value

int

WidthPixels

Gets the terminal width in pixels.

public int WidthPixels { get; }

Property Value

int

Remarks

A value of 0 means the pixel width is unspecified.

Methods

Equals(object?)

Determines whether this terminal size equals another object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare.

Returns

bool

true if the objects are equal.

Equals(TerminalSize)

Determines whether this terminal size equals another.

public bool Equals(TerminalSize other)

Parameters

other TerminalSize

The terminal size to compare.

Returns

bool

true if terminal sizes are equal.

GetHashCode()

Returns the hash code for this terminal size.

public override int GetHashCode()

Returns

int

Hash code.

ToString()

Returns a string representation of the terminal size.

public override string ToString()

Returns

string

String representation of the terminal size.