Raxol.Terminal.ModeState (Raxol v0.5.0)
View SourceManages terminal mode state and transitions.
This module is responsible for:
- Managing mode state
- Handling mode transitions
- Validating mode changes
- Providing mode state queries
Summary
Functions
Looks up a DEC private mode code and returns the corresponding mode atom.
Looks up a standard mode code and returns the corresponding mode atom.
Checks if a specific mode is enabled.
Creates a new mode state with default values.
Resets the alternate buffer mode.
Resets a mode to disabled state.
Sets the alternate buffer mode.
Sets a mode to enabled state.
Types
@type t() :: %Raxol.Terminal.ModeState{ active_buffer_type: term(), alt_screen_mode: term(), alternate_buffer_active: term(), auto_repeat_mode: term(), auto_wrap: term(), bracketed_paste_mode: term(), column_width_mode: term(), cursor_keys_mode: term(), cursor_visible: term(), focus_events_enabled: term(), insert_mode: term(), interlacing_mode: term(), line_feed_mode: term(), mouse_report_mode: term(), origin_mode: term(), screen_mode_reverse: term() }
Functions
Looks up a DEC private mode code and returns the corresponding mode atom.
Looks up a standard mode code and returns the corresponding mode atom.
Checks if a specific mode is enabled.
Parameters
state
- The current mode statemode
- The mode to check
Returns
boolean()
- Whether the mode is enabled
@spec new() :: t()
Creates a new mode state with default values.
Resets the alternate buffer mode.
Parameters
state
- The current mode state
Returns
t()
- The updated mode state
Resets a mode to disabled state.
Parameters
state
- The current mode statemode
- The mode to disable
Returns
t()
- The updated mode state
Sets the alternate buffer mode.
Parameters
state
- The current mode statetype
- The alternate buffer mode type
Returns
t()
- The updated mode state
Sets a mode to enabled state.
Parameters
state
- The current mode statemode
- The mode to enable
Returns
t()
- The updated mode state