Raxol.Terminal.State.TerminalStateManager (Raxol v2.0.1)
View SourceManages terminal state including modes, attributes, and state transitions. This module is responsible for maintaining and updating the terminal's state.
Summary
Functions
Returns a specification to start this module under a supervisor.
Clears the state stack. Returns the updated emulator.
Gets an attribute value. Returns the attribute value or nil.
Gets a mode value. Returns the mode value or nil.
Gets the current state stack. Returns the list of states.
Starts the state manager.
Creates a new state manager.
Pops a state from the stack. Returns {emulator, state} or {emulator, nil} if stack is empty.
Pushes the current state onto the stack. Returns the updated emulator.
Resets the state to its initial values. Returns the updated emulator.
Sets an attribute value. Returns the updated emulator.
Sets a mode value. Returns the updated emulator.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec clear_state_stack(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Clears the state stack. Returns the updated emulator.
@spec get_attribute(Raxol.Terminal.Emulator.t(), atom()) :: any()
Gets an attribute value. Returns the attribute value or nil.
@spec get_mode(Raxol.Terminal.Emulator.t(), atom()) :: any()
Gets a mode value. Returns the mode value or nil.
@spec get_state_stack(Raxol.Terminal.Emulator.t()) :: [Raxol.Terminal.State.t()]
Gets the current state stack. Returns the list of states.
Starts the state manager.
@spec new() :: Raxol.Terminal.State.t()
Creates a new state manager.
@spec pop_state(Raxol.Terminal.Emulator.t()) :: {Raxol.Terminal.Emulator.t(), Raxol.Terminal.State.t() | nil}
Pops a state from the stack. Returns {emulator, state} or {emulator, nil} if stack is empty.
@spec push_state(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Pushes the current state onto the stack. Returns the updated emulator.
@spec reset_state(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Resets the state to its initial values. Returns the updated emulator.
@spec set_attribute(Raxol.Terminal.Emulator.t(), atom(), any()) :: Raxol.Terminal.Emulator.t()
Sets an attribute value. Returns the updated emulator.
@spec set_mode(Raxol.Terminal.Emulator.t(), atom(), any()) :: Raxol.Terminal.Emulator.t()
Sets a mode value. Returns the updated emulator.