Raxol.Terminal.ScreenBuffer
(Raxol v2.3.0)
View Source
Manages the terminal's screen buffer state (grid, scrollback, selection). This module serves as the main interface for terminal buffer operations, delegating specific operations to specialized modules in Raxol.Terminal.Buffer.*.
Structure
The buffer consists of:
- A main grid of cells (the visible screen)
- A scrollback buffer for history
- Selection state
- Scroll region settings
- Dimensions (width and height)
Operations
The module delegates operations to specialized modules:
Content- Writing and content managementScrollRegion- Scroll region and scrolling operationsLineOperations- Line manipulationCharEditor- Character editingLineEditor- Line editingEraser- Clearing operationsSelection- Text selectionScrollback- History managementQueries- State queryingInitializer- Buffer creation and validationCursor- Cursor state managementCharset- Character set managementFormatting- Text formatting and styling
Summary
Functions
Creates a new screen buffer with the specified dimensions. Validates and normalizes the input dimensions to ensure they are valid.
Types
@type t() :: %Raxol.Terminal.ScreenBuffer{ alternate_screen: boolean(), cells: [[Raxol.Terminal.Cell.t()]], cursor_blink: boolean(), cursor_position: {non_neg_integer(), non_neg_integer()}, cursor_style: atom(), cursor_visible: boolean(), damage_regions: [ {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()} ], default_style: Raxol.Terminal.ANSI.TextFormatting.text_style(), height: non_neg_integer(), scroll_position: non_neg_integer(), scroll_region: {integer(), integer()} | nil, scrollback: [[Raxol.Terminal.Cell.t()]], scrollback_limit: non_neg_integer(), selection: {integer(), integer(), integer(), integer()} | nil, width: non_neg_integer() }
Functions
See Raxol.Terminal.ScreenBuffer.Selection.clear_selection/1.
See Raxol.Terminal.ScreenBuffer.Attributes.cursor_blinking?/1.
See Raxol.Terminal.ScreenBuffer.Attributes.cursor_visible?/1.
See Raxol.Terminal.Buffer.LineOperations.delete_lines_in_region/5.
See Raxol.Terminal.ScreenBuffer.RegionOperations.fill_region/6.
See Raxol.Terminal.ScreenBuffer.Attributes.get_cursor_position/1.
See Raxol.Terminal.ScreenBuffer.Attributes.get_cursor_style/1.
See Raxol.Terminal.ScreenBuffer.Selection.get_selected_text/1.
See Raxol.Terminal.ScreenBuffer.Selection.get_selection_boundaries/1.
See Raxol.Terminal.ScreenBuffer.Selection.get_selection_end/1.
See Raxol.Terminal.ScreenBuffer.Selection.get_selection_start/1.
See Raxol.Terminal.ScreenBuffer.Attributes.get_text_in_region/5.
See Raxol.Terminal.ScreenBuffer.RegionOperations.handle_single_line_replacement/5.
Creates a new screen buffer with the specified dimensions. Validates and normalizes the input dimensions to ensure they are valid.
See Raxol.Terminal.ScreenBuffer.Attributes.reset_charset_state/1.
See Raxol.Terminal.ScreenBuffer.Selection.selection_active?/1.
See Raxol.Terminal.ScreenBuffer.Attributes.set_cursor_blink/2.
See Raxol.Terminal.ScreenBuffer.Attributes.set_cursor_position/3.
See Raxol.Terminal.ScreenBuffer.Attributes.set_cursor_style/2.
See Raxol.Terminal.ScreenBuffer.Attributes.set_cursor_visibility/2.
See Raxol.Terminal.ScreenBuffer.Selection.start_selection/3.
See Raxol.Terminal.ScreenBuffer.Selection.update_selection/3.