TermUI (TermUI v0.2.0)

View Source

TermUI - A direct-mode Terminal UI framework for Elixir/BEAM.

This module provides the main entry point for terminal operations.

Summary

Functions

Enables raw mode and sets up the terminal for TUI operation.

Restores the terminal to its original state.

Gets the current terminal size.

Functions

init()

@spec init() :: {:ok, TermUI.Terminal.State.t()} | {:error, term()}

Enables raw mode and sets up the terminal for TUI operation.

This is a convenience function that:

  1. Starts the Terminal GenServer if needed
  2. Enables raw mode
  3. Enters the alternate screen
  4. Hides the cursor

Returns {:ok, state} on success or {:error, reason} on failure.

shutdown()

@spec shutdown() :: :ok

Restores the terminal to its original state.

This is a convenience function that performs complete terminal restoration.

size()

@spec size() :: {:ok, {pos_integer(), pos_integer()}} | {:error, term()}

Gets the current terminal size.

Returns {:ok, {rows, cols}} or {:error, reason}.