Raxol.Terminal.InputHandler (Raxol v0.2.0)

View Source

Handles input processing for the terminal emulator.

This module is responsible for processing input from stdin and other sources, managing the input buffer, and handling special keys and combinations.

Note: When running in certain environments, stdin may be excluded from Credo analysis due to how it's processed. This is expected behavior and doesn't affect functionality.

Summary

Functions

Handles clipboard copy operation.

Handles clipboard cut operation.

Handles clipboard paste operation.

Inserts text at the specified position in the buffer.

Creates a new input handler with default values.

Types

t()

@type t() :: %Raxol.Terminal.InputHandler{
  buffer: String.t(),
  clipboard: Raxol.Terminal.Clipboard.t(),
  cursor_position: non_neg_integer(),
  tab_completion: map(),
  tab_completion_index: non_neg_integer(),
  tab_completion_matches: [String.t()]
}

Functions

handle_copy(handler)

@spec handle_copy(t()) :: {:ok, t()} | {:error, String.t()}

Handles clipboard copy operation.

handle_cut(handler)

@spec handle_cut(t()) :: {:ok, t()} | {:error, String.t()}

Handles clipboard cut operation.

handle_paste(handler)

@spec handle_paste(t()) :: {:ok, t()} | {:error, String.t()}

Handles clipboard paste operation.

insert_text(buffer, position, text)

@spec insert_text(String.t(), non_neg_integer(), String.t()) :: String.t()

Inserts text at the specified position in the buffer.

new()

@spec new() :: t()

Creates a new input handler with default values.