Raxol.Terminal.Emulator.Buffer (Raxol v0.5.0)

View Source

Provides buffer management functionality for the terminal emulator.

Summary

Functions

Clears the entire buffer.

Clears from cursor to end of screen.

Clears from start of screen to cursor.

Clears the current line.

Clears the scroll region, allowing scrolling of the entire screen. Returns {:ok, updated_emulator}.

Scrolls the buffer down by the specified number of lines.

Scrolls the buffer up by the specified number of lines.

Sets the scroll region for the active buffer. Returns {:ok, updated_emulator} or {:error, reason}.

Switches between main and alternate screen buffers. Returns {:ok, updated_emulator} or {:error, reason}.

Functions

clear_buffer(emulator)

Clears the entire buffer.

clear_from_cursor_to_end(emulator)

Clears from cursor to end of screen.

clear_from_cursor_to_start(emulator)

Clears from start of screen to cursor.

clear_line(emulator)

Clears the current line.

clear_scroll_region(emulator)

@spec clear_scroll_region(Raxol.Terminal.Emulator.Struct.t()) ::
  {:ok, Raxol.Terminal.Emulator.Struct.t()}

Clears the scroll region, allowing scrolling of the entire screen. Returns {:ok, updated_emulator}.

scroll_down(emulator, lines)

Scrolls the buffer down by the specified number of lines.

scroll_up_emulator(emulator, lines)

Scrolls the buffer up by the specified number of lines.

set_scroll_region(emulator, top, bottom)

Sets the scroll region for the active buffer. Returns {:ok, updated_emulator} or {:error, reason}.

switch_buffer(emulator, invalid_type)

@spec switch_buffer(Raxol.Terminal.Emulator.Struct.t(), :main | :alternate) ::
  {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}

Switches between main and alternate screen buffers. Returns {:ok, updated_emulator} or {:error, reason}.