Raxol.Terminal.ANSI.TerminalState (Raxol v0.4.0)
View SourceManages terminal state for the terminal emulator. Handles saving and restoring terminal state, including cursor position, attributes, character sets, and screen modes.
Summary
Functions
Applies specified fields from restored data onto the current emulator state.
Clears the terminal state stack.
Gets the number of saved states in the stack.
Checks if the terminal state stack is empty.
Gets the current terminal state stack.
Creates a new terminal state stack.
Restores the most recently saved terminal state from the stack. Returns the updated stack and the restored state.
Saves the current terminal state to the stack.
Types
@type saved_state() :: %{ cursor: {non_neg_integer(), non_neg_integer()}, attributes: map(), charset_state: Raxol.Terminal.ANSI.CharacterSets.charset_state(), mode_manager: Raxol.Terminal.ANSI.ScreenModes.screen_state(), scroll_region: {non_neg_integer(), non_neg_integer()} | nil, cursor_style: atom() }
@type state_stack() :: [saved_state()]
Functions
Applies specified fields from restored data onto the current emulator state.
@spec clear_state(state_stack()) :: state_stack()
Clears the terminal state stack.
@spec count(state_stack()) :: non_neg_integer()
Gets the number of saved states in the stack.
@spec empty?(state_stack()) :: boolean()
Checks if the terminal state stack is empty.
@spec get_state_stack(state_stack()) :: state_stack()
Gets the current terminal state stack.
@spec new() :: state_stack()
Creates a new terminal state stack.
@spec restore_state(state_stack()) :: {state_stack(), map() | nil}
Restores the most recently saved terminal state from the stack. Returns the updated stack and the restored state.
@spec save_state(state_stack(), map()) :: state_stack()
Saves the current terminal state to the stack.