Alaja.Terminal (Alaja v1.0.0)

Copy Markdown View Source

Terminal size detection utilities.

Wraps :io.columns/0 and :io.rows/0 with sensible fallbacks for non-TTY environments.

Summary

Functions

Returns the terminal height in rows.

Returns the current terminal dimensions as {columns, rows}.

Returns the terminal width in columns.

Functions

height()

@spec height() :: pos_integer()

Returns the terminal height in rows.

size()

@spec size() :: {pos_integer(), pos_integer()}

Returns the current terminal dimensions as {columns, rows}.

Falls back to {80, 24} if the terminal size cannot be detected (e.g., in non-TTY environments, CI, or when stdout is redirected).

width()

@spec width() :: pos_integer()

Returns the terminal width in columns.