LEVIATHAN v962456e · 962456eee1

Standard Library · term

class WinSize

The size of a terminal window in character cells.

since 0.1.0-alpha.1linux

Examples

term::WinSize size = term::WinSize(30, 100);
console.writeln("${size.rows} rows");
console.writeln("${size.cols} columns");
30 rows
100 columns

Constructors

new

new()

Create the default window size of 24 rows by 80 columns.

Examples

term::WinSize size = term::WinSize();
console.writeln("${size.rows}x${size.cols}");
24x80
new(int r, int c)

Create a window size from a row and a column count.

Parameters

r
The number of rows.
c
The number of columns.

Fields

cols

int cols

The number of text columns.

rows

int rows

The number of text rows.

See also

  • size — Ask for the size of the terminal window.