Raxol.Terminal.ANSI.Processor (Raxol v0.4.0)
View SourceANSI sequence processor module.
This module processes ANSI escape sequences for terminal control, including:
- Cursor movement
- Text formatting
- Screen manipulation
- Terminal state changes
- Bracketed paste mode
- Focus reporting
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the current buffer manager.
Callback implementation for GenServer.init/1
.
Process a parsed ANSI sequence and return the updated emulator state. This is a direct interface for processing sequences without using the GenServer.
Processes an ANSI sequence.
Sets the buffer manager for the processor.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Gets the current buffer manager.
Examples
iex> {:ok, processor} = Processor.start_link([])
iex> {:ok, buffer_manager} = Manager.new(80, 24)
iex> :ok = Processor.set_buffer_manager(processor, buffer_manager)
iex> Processor.get_buffer_manager(processor)
{:ok, ^buffer_manager}
Callback implementation for GenServer.init/1
.
Process a parsed ANSI sequence and return the updated emulator state. This is a direct interface for processing sequences without using the GenServer.
Parameters
sequence
- The parsed ANSI sequence (result from Parser.parse_sequence/1)emulator
- The current emulator state
Returns
Updated emulator state
Examples
iex> sequence = Raxol.Terminal.ANSI.Parser.parse_sequence("[31m")
iex> new_state = Raxol.Terminal.ANSI.Processor.process(sequence, emulator)
Processes an ANSI sequence.
Examples
iex> {:ok, processor} = Processor.start_link([])
iex> {:ok, buffer_manager} = Manager.new(80, 24)
iex> :ok = Processor.set_buffer_manager(processor, buffer_manager)
iex> {:ok, _} = Processor.process_sequence(processor, "[31m")
:ok
Sets the buffer manager for the processor.
Examples
iex> {:ok, processor} = Processor.start_link([])
iex> {:ok, buffer_manager} = Manager.new(80, 24)
iex> :ok = Processor.set_buffer_manager(processor, buffer_manager)
:ok