Raxol.Terminal.ScreenBuffer.Output (Raxol v0.5.0)

View Source

Handles output buffer operations for the terminal screen buffer. This module manages the output buffer state and provides functions for writing, flushing, and clearing the buffer.

Summary

Functions

Clears the output buffer and control sequences. Returns a new output buffer state with empty buffer and control sequences.

Enqueues a control sequence to be processed. Returns a new output buffer state with the sequence added to the queue.

Flushes the output buffer. Returns a new output buffer state with an empty buffer.

Writes data to the output buffer. Returns a new output buffer state with the data appended.

Types

t()

@type t() :: %Raxol.Terminal.ScreenBuffer.Output{
  buffer: String.t(),
  control_sequences: [String.t()]
}

Functions

clear(state)

@spec clear(t()) :: t()

Clears the output buffer and control sequences. Returns a new output buffer state with empty buffer and control sequences.

enqueue_control_sequence(state, sequence)

@spec enqueue_control_sequence(t(), String.t()) :: t()

Enqueues a control sequence to be processed. Returns a new output buffer state with the sequence added to the queue.

flush(state)

@spec flush(t()) :: t()

Flushes the output buffer. Returns a new output buffer state with an empty buffer.

write(state, data)

@spec write(t(), String.t()) :: t()

Writes data to the output buffer. Returns a new output buffer state with the data appended.