TermUI (TermUI v0.2.0)
View SourceTermUI - 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
@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:
- Starts the Terminal GenServer if needed
- Enables raw mode
- Enters the alternate screen
- Hides the cursor
Returns {:ok, state} on success or {:error, reason} on failure.
@spec shutdown() :: :ok
Restores the terminal to its original state.
This is a convenience function that performs complete terminal restoration.
@spec size() :: {:ok, {pos_integer(), pos_integer()}} | {:error, term()}
Gets the current terminal size.
Returns {:ok, {rows, cols}} or {:error, reason}.