Raxol.Terminal.OutputManager (Raxol v2.0.1)
View SourceManages terminal output operations including writing, flushing, and output buffering. This module is responsible for handling all output-related operations in the terminal.
Summary
Functions
Clears the output buffer. Returns the updated emulator.
Checks if the output buffer is empty. Returns true if the buffer is empty, false otherwise.
Flushes the output buffer. Returns {:ok, updated_emulator} or {:error, reason}.
Formats ANSI escape sequences for display. Returns the formatted string with ANSI sequences replaced by readable descriptions.
Formats control characters for display. Returns the formatted string.
Formats Unicode characters for display. Returns the formatted string.
Gets the output buffer instance. Returns the output buffer.
Gets the current output buffer content. Returns the buffer content as a string.
Gets the current output buffer encoding. Returns the current encoding.
Gets the current output buffer mode. Returns the current mode.
Gets the output buffer size. Returns the number of bytes in the buffer.
Sets the output buffer content. Returns the updated emulator.
Sets the output buffer encoding. Returns the updated emulator.
Sets the output buffer mode. Returns the updated emulator.
Updates the output buffer instance. Returns the updated emulator.
Writes a string to the output buffer. Returns the updated emulator.
Writes a string to the output buffer with a newline. Returns the updated emulator.
Functions
@spec clear(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Clears the output buffer. Returns the updated emulator.
@spec empty?(Raxol.Terminal.Emulator.t()) :: boolean()
Checks if the output buffer is empty. Returns true if the buffer is empty, false otherwise.
@spec flush(Raxol.Terminal.Emulator.t()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Flushes the output buffer. Returns {:ok, updated_emulator} or {:error, reason}.
Formats ANSI escape sequences for display. Returns the formatted string with ANSI sequences replaced by readable descriptions.
Formats control characters for display. Returns the formatted string.
Formats Unicode characters for display. Returns the formatted string.
@spec get_buffer(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.OutputBuffer.t()
Gets the output buffer instance. Returns the output buffer.
@spec get_content(Raxol.Terminal.Emulator.t()) :: String.t()
Gets the current output buffer content. Returns the buffer content as a string.
@spec get_encoding(Raxol.Terminal.Emulator.t()) :: String.t()
Gets the current output buffer encoding. Returns the current encoding.
@spec get_mode(Raxol.Terminal.Emulator.t()) :: atom()
Gets the current output buffer mode. Returns the current mode.
@spec get_size(Raxol.Terminal.Emulator.t()) :: non_neg_integer()
Gets the output buffer size. Returns the number of bytes in the buffer.
@spec set_content(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Sets the output buffer content. Returns the updated emulator.
@spec set_encoding(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Sets the output buffer encoding. Returns the updated emulator.
@spec set_mode(Raxol.Terminal.Emulator.t(), atom()) :: Raxol.Terminal.Emulator.t()
Sets the output buffer mode. Returns the updated emulator.
@spec update_buffer(Raxol.Terminal.Emulator.t(), Raxol.Terminal.OutputBuffer.t()) :: Raxol.Terminal.Emulator.t()
Updates the output buffer instance. Returns the updated emulator.
@spec write(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Writes a string to the output buffer. Returns the updated emulator.
@spec writeln(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Writes a string to the output buffer with a newline. Returns the updated emulator.