Skip to content

#[final] Geometry

The dimensions of a Console, as geometry() reports them.

rows and cols are independently nil: a console may know one dimension without the other.

let g = Geometry rows: 24 cols: 80
assert_eq $g.cols 80

Fields

cols @ (Int | nil) [get]

Width in character cells, or nil if unknown.

let g = term.console.geometry()
if g.cols
  echo $ term.preformat $ "-" * g.cols
rows @ (Int | nil) [get]

Height in character cells, or nil if unknown.