Raxol.Terminal.Emulator.Buffer (Raxol v0.3.0)
View SourceHandles screen buffer management for the terminal emulator. Provides functions for buffer operations, scroll region handling, and buffer switching.
Summary
Functions
Clears the active buffer. Returns {:ok, updated_emulator} or {:error, reason}.
Clears the active buffer from cursor to end of screen. Returns {:ok, updated_emulator} or {:error, reason}.
Clears the active buffer from cursor to start of screen. Returns {:ok, updated_emulator} or {:error, reason}.
Clears the current line in the active buffer. Returns {:ok, updated_emulator} or {:error, reason}.
Clears the scroll region, allowing scrolling of the entire screen. Returns {:ok, updated_emulator}.
Scrolls the active buffer down by the specified number of lines. Returns {:ok, updated_emulator} or {:error, reason}.
Scrolls the active buffer up by the specified number of lines. Returns {:ok, updated_emulator} or {:error, reason}.
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
@spec clear_buffer(Raxol.Terminal.Core.t()) :: {:ok, Raxol.Terminal.Core.t()} | {:error, String.t()}
Clears the active buffer. Returns {:ok, updated_emulator} or {:error, reason}.
@spec clear_from_cursor_to_end(Raxol.Terminal.Core.t()) :: {:ok, Raxol.Terminal.Core.t()} | {:error, String.t()}
Clears the active buffer from cursor to end of screen. Returns {:ok, updated_emulator} or {:error, reason}.
@spec clear_from_cursor_to_start(Raxol.Terminal.Core.t()) :: {:ok, Raxol.Terminal.Core.t()} | {:error, String.t()}
Clears the active buffer from cursor to start of screen. Returns {:ok, updated_emulator} or {:error, reason}.
@spec clear_line(Raxol.Terminal.Core.t()) :: {:ok, Raxol.Terminal.Core.t()} | {:error, String.t()}
Clears the current line in the active buffer. Returns {:ok, updated_emulator} or {:error, reason}.
@spec clear_scroll_region(Raxol.Terminal.Core.t()) :: {:ok, Raxol.Terminal.Core.t()}
Clears the scroll region, allowing scrolling of the entire screen. Returns {:ok, updated_emulator}.
@spec scroll_down(Raxol.Terminal.Core.t(), non_neg_integer()) :: {:ok, Raxol.Terminal.Core.t()} | {:error, String.t()}
Scrolls the active buffer down by the specified number of lines. Returns {:ok, updated_emulator} or {:error, reason}.
@spec scroll_up(Raxol.Terminal.Core.t(), non_neg_integer()) :: {:ok, Raxol.Terminal.Core.t()} | {:error, String.t()}
Scrolls the active buffer up by the specified number of lines. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_scroll_region(Raxol.Terminal.Core.t(), non_neg_integer(), non_neg_integer()) :: {:ok, Raxol.Terminal.Core.t()} | {:error, String.t()}
Sets the scroll region for the active buffer. Returns {:ok, updated_emulator} or {:error, reason}.
@spec switch_buffer(Raxol.Terminal.Core.t(), :main | :alternate) :: {:ok, Raxol.Terminal.Core.t()} | {:error, String.t()}
Switches between main and alternate screen buffers. Returns {:ok, updated_emulator} or {:error, reason}.