Raxol.Terminal.State.Manager (Raxol v0.5.0)

View Source

Manages the overall state of the terminal, including mode settings, cursor state, and terminal dimensions.

Summary

Functions

Gets the current cursor position.

Gets the cursor style.

Gets the cursor visibility state.

Gets the current terminal dimensions.

Gets the terminal icon name.

Gets the value of a terminal mode.

Gets the terminal title.

Creates a new terminal state manager instance.

Resets the terminal state to default values.

Restores the saved cursor state.

Saves the current cursor state.

Sets the cursor position.

Sets the cursor style.

Sets the cursor visibility.

Sets the terminal dimensions.

Sets the terminal icon name.

Sets a terminal mode value.

Sets the terminal title.

Triggers the terminal bell.

Types

bell_style()

@type bell_style() :: :normal | :visible | :audible | :urgent

bell_urgent_style()

@type bell_urgent_style() :: :normal | :visible | :audible | :urgent

cursor_style()

@type cursor_style() :: :block | :underline | :bar

mode()

@type mode() :: atom()

mode_value()

@type mode_value() :: boolean()

t()

@type t() :: %Raxol.Terminal.State.Manager{
  bell_audible: boolean(),
  bell_duration: non_neg_integer(),
  bell_enabled: boolean(),
  bell_pitch: non_neg_integer(),
  bell_style: bell_style(),
  bell_urgent: boolean(),
  bell_urgent_active: boolean(),
  bell_urgent_audible: boolean(),
  bell_urgent_count: non_neg_integer(),
  bell_urgent_duration: non_neg_integer(),
  bell_urgent_last: DateTime.t() | nil,
  bell_urgent_max: non_neg_integer(),
  bell_urgent_pitch: non_neg_integer(),
  bell_urgent_style: bell_urgent_style(),
  bell_urgent_timeout: non_neg_integer(),
  bell_urgent_visible: boolean(),
  bell_urgent_volume: non_neg_integer(),
  bell_visible: boolean(),
  bell_volume: non_neg_integer(),
  cols: non_neg_integer(),
  cursor_style: cursor_style(),
  cursor_visible: boolean(),
  cursor_x: non_neg_integer(),
  cursor_y: non_neg_integer(),
  icon_name: String.t(),
  modes: %{required(mode()) => mode_value()},
  rows: non_neg_integer(),
  saved_cursor: {non_neg_integer(), non_neg_integer()} | nil,
  scrollback_size: non_neg_integer(),
  title: String.t()
}

Functions

get_cursor_position(state)

Gets the current cursor position.

get_cursor_style(state)

Gets the cursor style.

get_cursor_visibility(state)

Gets the cursor visibility state.

get_dimensions(state)

Gets the current terminal dimensions.

get_icon_name(state)

Gets the terminal icon name.

get_mode(state, mode)

Gets the value of a terminal mode.

get_title(state)

Gets the terminal title.

new(opts \\ [])

Creates a new terminal state manager instance.

reset(state)

Resets the terminal state to default values.

restore_cursor(state)

Restores the saved cursor state.

save_cursor(state)

Saves the current cursor state.

set_cursor_position(state, x, y)

Sets the cursor position.

set_cursor_style(state, style)

Sets the cursor style.

set_cursor_visibility(state, visible)

Sets the cursor visibility.

set_dimensions(state, rows, cols)

Sets the terminal dimensions.

set_icon_name(state, name)

Sets the terminal icon name.

set_mode(state, mode, value)

Sets a terminal mode value.

set_title(state, title)

Sets the terminal title.

trigger_bell(state)

Triggers the terminal bell.