Linx.Tty.WindowSize (Linx v0.1.0)

Copy Markdown View Source

The size of a terminal — rows, columns, and optional pixel dimensions. The shape of struct winsize from <sys/ioctl.h>.

Returned by Linx.Tty.window_size/1; passed to Linx.Tty.set_window_size/2 and Linx.Process.pty_set_winsize/2.

rows and cols are what every terminal-aware program cares about (vim, top, less). xpixel / ypixel are the legacy pixel-dimensions fields — almost always reported as 0 by modern terminal emulators and ignored by most consumers; included for ABI faithfulness so a relay (e.g. Linx.Tty.attach/2) can shuttle the full struct.

Summary

Types

t()

@type t() :: %Linx.Tty.WindowSize{
  cols: non_neg_integer(),
  rows: non_neg_integer(),
  xpixel: non_neg_integer(),
  ypixel: non_neg_integer()
}