Raxol.Terminal.Clipboard (Raxol v0.2.0)

View Source

Handles clipboard operations for the terminal emulator.

This module provides functionality for:

  • Copying text to the system clipboard
  • Pasting text from the system clipboard
  • Managing clipboard history

Summary

Functions

Clears the clipboard history.

Copies text to the system clipboard and adds it to the history.

Checks if clipboard operations are enabled.

Gets the clipboard history.

Creates a new clipboard manager with default values.

Retrieves text from the system clipboard.

Enables or disables clipboard operations.

Types

t()

@type t() :: %Raxol.Terminal.Clipboard{
  enabled: boolean(),
  history: [String.t()],
  history_limit: non_neg_integer()
}

Functions

clear_history(clipboard)

@spec clear_history(t()) :: t()

Clears the clipboard history.

copy(clipboard, text)

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

Copies text to the system clipboard and adds it to the history.

enabled?(clipboard)

@spec enabled?(t()) :: boolean()

Checks if clipboard operations are enabled.

get_history(clipboard)

@spec get_history(t()) :: [String.t()]

Gets the clipboard history.

new(history_limit \\ 100)

@spec new(non_neg_integer()) :: t()

Creates a new clipboard manager with default values.

paste(clipboard)

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

Retrieves text from the system clipboard.

set_enabled(clipboard, enabled)

@spec set_enabled(t(), boolean()) :: t()

Enables or disables clipboard operations.