Raxol.Terminal.ModeState (Raxol Terminal v2.6.0)

Copy Markdown View Source

Manages 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

t()

@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

lookup_private(code)

Looks up a DEC private mode code and returns the corresponding mode atom.

lookup_standard(code)

Looks up a standard mode code and returns the corresponding mode atom.

mode_enabled?(state, mode)

Checks if a specific mode is enabled.

Parameters

  • state - The current mode state
  • mode - The mode to check

Returns

  • boolean() - Whether the mode is enabled

new()

Creates a new mode state with default values.

reset_alternate_buffer_mode(state)

Resets the alternate buffer mode.

Parameters

  • state - The current mode state

Returns

  • t() - The updated mode state

reset_mode(state, mode)

Resets a mode to disabled state.

Parameters

  • state - The current mode state
  • mode - The mode to disable

Returns

  • t() - The updated mode state

set_alternate_buffer_mode(state, type)

Sets the alternate buffer mode.

Parameters

  • state - The current mode state
  • type - The alternate buffer mode type

Returns

  • t() - The updated mode state

set_mode(state, mode)

Sets a mode to enabled state.

Parameters

  • state - The current mode state
  • mode - The mode to enable

Returns

  • t() - The updated mode state