Raxol.Terminal.InputHandler (Raxol v0.4.0)
View SourceHandles parsed terminal input events (printable characters, control codes, escape sequences) and updates the Emulator state accordingly.
Summary
Functions
Handle a control sequence in the input.
Handles clipboard copy operation. (Currently copies the entire buffer)
Handles clipboard cut operation. (Currently cuts the entire buffer)
Handles clipboard paste operation.
Handles a printable character, using single_shift if set (for SS2/SS3).
Inserts text at the specified position in the buffer.
Creates a new input handler with default values.
Processes a single character codepoint. Delegates to C0 handlers or printable character handlers.
Process a complete input string, handling both normal characters and control sequences.
Process a character or string input, handling character sets and translations.
Processes a single printable character codepoint. Handles writing the character to the buffer, cursor advancement, and line wrapping.
Processes a raw input string for the terminal, parsing control sequences and printable characters. This function drives the terminal command parser.
Types
@type t() :: %Raxol.Terminal.InputHandler{ buffer: String.t(), cursor_position: non_neg_integer(), mode_manager: Raxol.Terminal.ModeManager.t(), tab_completion: map(), tab_completion_index: non_neg_integer(), tab_completion_matches: [String.t()] }
Functions
@spec handle_control_sequence(String.t(), Raxol.Terminal.ANSI.CharacterSets.t()) :: {String.t(), Raxol.Terminal.ANSI.CharacterSets.t()}
Handle a control sequence in the input.
Handles clipboard copy operation. (Currently copies the entire buffer)
Handles clipboard cut operation. (Currently cuts the entire buffer)
Handles clipboard paste operation.
@spec handle_printable_character( Raxol.Terminal.Emulator.t(), integer(), any(), nil | :ss2 | :ss3 ) :: {Raxol.Terminal.Emulator.t(), list()}
Handles a printable character, using single_shift if set (for SS2/SS3).
@spec insert_text(String.t(), non_neg_integer(), String.t()) :: String.t()
Inserts text at the specified position in the buffer.
@spec new() :: t()
Creates a new input handler with default values.
@spec process_character(Raxol.Terminal.Emulator.t(), integer()) :: Raxol.Terminal.Emulator.t()
Processes a single character codepoint. Delegates to C0 handlers or printable character handlers.
@spec process_complete_input(String.t(), Raxol.Terminal.ANSI.CharacterSets.t()) :: {String.t(), Raxol.Terminal.ANSI.CharacterSets.t()}
Process a complete input string, handling both normal characters and control sequences.
@spec process_input(String.t(), Raxol.Terminal.ANSI.CharacterSets.t()) :: {String.t(), Raxol.Terminal.ANSI.CharacterSets.t()}
Process a character or string input, handling character sets and translations.
@spec process_printable_character(Raxol.Terminal.Emulator.t(), integer()) :: Raxol.Terminal.Emulator.t()
Processes a single printable character codepoint. Handles writing the character to the buffer, cursor advancement, and line wrapping.
@spec process_terminal_input(Raxol.Terminal.Emulator.t(), String.t()) :: {Raxol.Terminal.Emulator.t(), String.t()}
Processes a raw input string for the terminal, parsing control sequences and printable characters. This function drives the terminal command parser.