Raxol.Terminal.ModeManager (Raxol Terminal v2.6.0)

Copy Markdown View Source

Manages terminal modes (DEC Private Modes, Standard Modes) and their effects.

This module centralizes the state and logic for various terminal modes, handling both simple flag toggles and modes with side effects on the emulator state (like screen buffer switching or resizing).

Summary

Functions

Gets the mode manager.

Gets the set modes.

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 the given mode is set.

Creates a new mode manager with default values.

Resets all modes.

Resets one or more modes. Dispatches to specific handlers. Returns potentially updated Emulator state if side effects occurred.

Restores the saved modes.

Restores the previously saved terminal state.

Saves the current modes.

Saves the current terminal state.

Sets one or more modes. Dispatches to specific handlers. Returns potentially updated Emulator state if side effects occurred.

Sets a mode with a value and options.

Sets a mode with a value and private flag.

Sets a private mode with a value.

Sets a standard mode with a value.

Updates the auto repeat mode.

Updates the auto wrap mode.

Updates the bracketed paste mode.

Updates the column width 132 mode.

Updates the cursor visible mode.

Updates the insert mode.

Updates the interlacing mode.

Updates the line feed mode.

Updates the mode manager.

Updates the origin mode.

Updates the screen mode reverse.

Types

mode()

@type mode() :: atom()

t()

@type t() :: %Raxol.Terminal.ModeManager{
  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

get_manager(state)

Gets the mode manager.

get_set_modes(state)

Gets the set modes.

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)

mode_set?(state, mode)

Checks if the given mode is set.

new()

Creates a new mode manager with default values.

reset_all_modes(state)

Resets all modes.

reset_mode(emulator, modes, category \\ nil)

Resets one or more modes. Dispatches to specific handlers. Returns potentially updated Emulator state if side effects occurred.

restore_modes(state)

Restores the saved modes.

restore_state(emulator)

Restores the previously saved terminal state.

save_modes(state)

Saves the current modes.

save_state(emulator)

Saves the current terminal state.

set_mode(emulator, modes, category \\ nil)

Sets one or more modes. Dispatches to specific handlers. Returns potentially updated Emulator state if side effects occurred.

set_mode(emulator, mode_name, value, options)

Sets a mode with a value and options.

set_mode_with_private(emulator, mode, value, private)

Sets a mode with a value and private flag.

set_private_mode(emulator, mode, value)

Sets a private mode with a value.

set_standard_mode(emulator, mode, value)

Sets a standard mode with a value.

update_auto_repeat_mode(emulator, value)

Updates the auto repeat mode.

update_auto_wrap_mode(emulator, value)

Updates the auto wrap mode.

update_bracketed_paste_mode(emulator, value)

Updates the bracketed paste mode.

update_column_width_132(emulator, value)

Updates the column width 132 mode.

update_cursor_visible(emulator, value)

Updates the cursor visible mode.

update_insert_mode(emulator, value)

Updates the insert mode.

update_interlacing_mode(emulator, value)

Updates the interlacing mode.

update_line_feed_mode(emulator, value)

Updates the line feed mode.

update_manager(state, modes)

Updates the mode manager.

update_origin_mode(emulator, value)

Updates the origin mode.

update_screen_mode_reverse(emulator, value)

Updates the screen mode reverse.