Skip to content
ConsoleMonster

API Reference

Class

TerminalSize

Namespace ConsoleMonster.Output
Assembly ConsoleMonster
Modifiers static

Reads the visible window size, rather than the scrollback buffer; safe to call every frame.

Inheritance

  • Object
  • TerminalSize

Methods

public static Boolean TryGet(out Int32 width, out Int32 height) #
Returns: Boolean

Tries to read the visible size without throwing.

Parameters

width System.Int32 requiredposition: 0
Columns, or zero when unavailable.
height System.Int32 requiredposition: 1
Rows, or zero when unavailable.

Returns

Whether a positive size was read.

public static Boolean TryGetWindow(out Int32 left, out Int32 top, out Int32 width, out Int32 height) #
Returns: Boolean

Reads the visible window's position in the screen buffer and its size. On Windows consoles the position changes when the user scrolls the window; elsewhere it is always (0, 0).

Parameters

left System.Int32 requiredposition: 0
The window's left column in the buffer.
top System.Int32 requiredposition: 1
The window's top row in the buffer.
width System.Int32 requiredposition: 2
The window width in cells.
height System.Int32 requiredposition: 3
The window height in cells.

Returns

True when the window could be read.