Raxol.Terminal.Emulator.State (Raxol v0.4.0)
View SourceHandles state management for the terminal emulator. Provides functions for managing terminal state, modes, and character sets.
Summary
Functions
Gets the current character set state. Returns the current charset state.
Gets the current state from the state stack. Returns the current state or nil if stack is empty.
Gets the current hyperlink URL. Returns the current hyperlink URL or nil.
Gets the current memory limit. Returns the memory limit.
Gets the value of a terminal mode. Returns the mode value or nil if not set.
Gets the current tab stops. Returns the current tab stops.
Pops a state from the state stack. Returns {:ok, updated_emulator} or {:error, reason}.
Pushes a new state onto the state stack. Returns {:ok, updated_emulator} or {:error, reason}.
Sets the character set state. Returns {:ok, updated_emulator} or {:error, reason}.
Sets the current hyperlink URL. Returns {:ok, updated_emulator}.
Sets the memory limit for the terminal. Returns {:ok, updated_emulator} or {:error, reason}.
Sets a terminal mode. Returns {:ok, updated_emulator} or {:error, reason}.
Sets the tab stops for the terminal. Returns {:ok, updated_emulator}.
Functions
@spec get_charset_state(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.ANSI.CharacterSets.charset_state()
Gets the current character set state. Returns the current charset state.
@spec get_current_state(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.ANSI.TerminalState.t() | nil
Gets the current state from the state stack. Returns the current state or nil if stack is empty.
@spec get_hyperlink_url(Raxol.Terminal.Emulator.t()) :: String.t() | nil
Gets the current hyperlink URL. Returns the current hyperlink URL or nil.
@spec get_memory_limit(Raxol.Terminal.Emulator.t()) :: non_neg_integer()
Gets the current memory limit. Returns the memory limit.
@spec get_mode(Raxol.Terminal.Emulator.t(), atom()) :: boolean() | nil
Gets the value of a terminal mode. Returns the mode value or nil if not set.
@spec get_tab_stops(Raxol.Terminal.Emulator.t()) :: MapSet.t()
Gets the current tab stops. Returns the current tab stops.
@spec pop_state(Raxol.Terminal.Emulator.t()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Pops a state from the state stack. Returns {:ok, updated_emulator} or {:error, reason}.
@spec push_state(Raxol.Terminal.Emulator.t()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Pushes a new state onto the state stack. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_charset_state( Raxol.Terminal.Emulator.t(), Raxol.Terminal.ANSI.CharacterSets.charset_state() ) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Sets the character set state. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_hyperlink_url(Raxol.Terminal.Emulator.t(), String.t() | nil) :: {:ok, Raxol.Terminal.Emulator.t()}
Sets the current hyperlink URL. Returns {:ok, updated_emulator}.
@spec set_memory_limit(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Sets the memory limit for the terminal. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_mode(Raxol.Terminal.Emulator.t(), atom(), boolean()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Sets a terminal mode. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_tab_stops(Raxol.Terminal.Emulator.t(), MapSet.t()) :: {:ok, Raxol.Terminal.Emulator.t()}
Sets the tab stops for the terminal. Returns {:ok, updated_emulator}.