Raxol.Terminal.ScreenManager (Raxol Terminal v2.6.0)

Copy Markdown View Source

Manages screen buffer operations for the terminal emulator. This module handles operations related to the main and alternate screen buffers, including buffer switching, initialization, and state management.

Summary

Functions

Clears the current selection.

Gets the current buffer type (main or alternate).

Gets the currently active screen buffer.

Gets the scroll bottom from the active buffer.

Gets the scroll region from the active buffer.

Gets the scroll top from the active buffer.

Gets the selected text from the buffer.

Gets the current selection from the buffer.

Gets the selection boundaries as {start, end} tuple.

Gets the selection end coordinates.

Gets the selection start coordinates.

Gets the current state of the buffer.

Gets the current style of the buffer.

Gets the style at a specific position.

Gets the style at the cursor position.

Checks if a position is within the current selection.

Initializes both main and alternate screen buffers with default scrollback limit.

Initializes both main and alternate screen buffers.

Parses scrollback limit from options, defaulting to 1000.

Checks if a selection is currently active.

Sets the buffer type.

Sets the scroll region on the buffer.

Starts a selection at the specified position.

Switches between main and alternate screen buffers.

Updates the currently active screen buffer.

Updates the selection end position.

Writes a string to the buffer at the given position with the given style.

Functions

clear_selection(buffer)

Clears the current selection.

get_buffer_type(emulator)

Gets the current buffer type (main or alternate).

get_screen_buffer(emulator)

Gets the currently active screen buffer.

get_scroll_bottom(buffer)

Gets the scroll bottom from the active buffer.

get_scroll_region(buffer)

Gets the scroll region from the active buffer.

get_scroll_top(buffer)

Gets the scroll top from the active buffer.

get_selected_text(buffer)

Gets the selected text from the buffer.

get_selection(buffer)

Gets the current selection from the buffer.

get_selection_boundaries(buffer)

Gets the selection boundaries as {start, end} tuple.

get_selection_end(buffer)

Gets the selection end coordinates.

get_selection_start(buffer)

Gets the selection start coordinates.

get_state(buffer)

Gets the current state of the buffer.

get_style(buffer)

Gets the current style of the buffer.

get_style_at(buffer, x, y)

Gets the style at a specific position.

get_style_at_cursor(buffer)

Gets the style at the cursor position.

in_selection?(buffer, x, y)

Checks if a position is within the current selection.

initialize_buffers(width, height)

Initializes both main and alternate screen buffers with default scrollback limit.

initialize_buffers(width, height, scrollback_limit)

Initializes both main and alternate screen buffers.

parse_scrollback_limit(opts)

Parses scrollback limit from options, defaulting to 1000.

resize_buffers(emulator, new_width, new_height)

Resizes both screen buffers.

selection_active?(buffer)

Checks if a selection is currently active.

set_buffer_type(emulator, type)

Sets the buffer type.

set_scroll_region(buffer, arg)

Sets the scroll region on the buffer.

start_selection(buffer, x, y)

Starts a selection at the specified position.

switch_buffer(emulator)

Switches between main and alternate screen buffers.

update_active_buffer(emulator, new_buffer)

Updates the currently active screen buffer.

update_selection(buffer, x, y)

Updates the selection end position.

write_string(buffer, x, y, string, style)

Writes a string to the buffer at the given position with the given style.