Raxol.Terminal.Emulator.Core (Raxol v2.0.1)
View SourceHandles core emulator functionality including input processing and scrolling.
This module provides core emulator operations including:
- Input processing
- Scrolling logic
- Cursor position management
- Buffer management
Summary
Functions
Ensures the cursor is in the visible region by scrolling if necessary.
Gets the active buffer from the emulator.
Checks if scrolling is needed and performs it if necessary.
Processes input for the emulator.
Resizes the terminal emulator to new dimensions.
Updates the active buffer in the emulator.
Writes a string to the emulator with charset translation.
Functions
Ensures the cursor is in the visible region by scrolling if necessary.
Parameters
emulator- The emulator state
Returns
Updated emulator with cursor in visible region.
@spec get_screen_buffer(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.ScreenBuffer.t()
Gets the active buffer from the emulator.
Parameters
emulator- The emulator state
Returns
The active screen buffer.
@spec maybe_scroll(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Checks if scrolling is needed and performs it if necessary.
Parameters
emulator- The emulator state
Returns
Updated emulator after scrolling.
@spec process_input(Raxol.Terminal.Emulator.t(), binary()) :: {Raxol.Terminal.Emulator.t(), binary()}
Processes input for the emulator.
Parameters
emulator- The emulator stateinput- Input to process
Returns
A tuple {updated_emulator, output}.
@spec resize( Raxol.Terminal.Emulator.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.t()
Resizes the terminal emulator to new dimensions.
Parameters
emulator- The emulator statewidth- New widthheight- New height
Returns
Updated emulator with new dimensions.
Updates the active buffer in the emulator.
Parameters
emulator- The emulator statenew_buffer- The new buffer to set
Returns
Updated emulator with new buffer.
Writes a string to the emulator with charset translation.
Parameters
emulator- The emulator statex- X coordinatey- Y coordinatestring- String to writestyle- Style to apply
Returns
Updated emulator.