Raxol.Terminal.Split.SplitManager (Raxol Terminal v2.6.0)

Copy Markdown View Source

Manages terminal split windows and panes.

Each split can optionally be bound to a ConcurrentBuffer pid and a TerminalProcess pid, enabling the cockpit to map panes to live terminal buffers.

Summary

Functions

Binds a ConcurrentBuffer and optional TerminalProcess to a split.

Returns a specification to start this module under a supervisor.

Creates a new split with the given options.

Gets the buffer pid bound to a split.

Lists all splits.

Navigates to an existing split.

Removes a split by id.

Resizes an existing split.

Sets a label on a split (for display in pane headers).

Unbinds the buffer from a split.

Types

t()

@type t() :: %Raxol.Terminal.Split.SplitManager{
  buffer_pid: pid() | nil,
  content: map(),
  created_at: DateTime.t(),
  dimensions: %{width: integer(), height: integer()},
  id: integer(),
  label: String.t() | nil,
  position: %{x: integer(), y: integer()},
  terminal_pid: pid() | nil
}

Functions

bind_buffer(split_id, manager_pid, buffer_pid, terminal_pid \\ nil)

@spec bind_buffer(integer(), pid(), pid(), pid() | nil) ::
  {:ok, t()} | {:error, :not_found}

Binds a ConcurrentBuffer and optional TerminalProcess to a split.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

create_split(opts \\ %{}, pid)

@spec create_split(map(), pid()) :: {:ok, t()} | {:error, term()}

Creates a new split with the given options.

get_split_buffer(split_id, manager_pid)

@spec get_split_buffer(integer(), pid()) ::
  {:ok, pid()} | {:error, :not_found | :no_buffer}

Gets the buffer pid bound to a split.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

list_splits(pid)

@spec list_splits(pid()) :: [t()]

Lists all splits.

remove_split(split_id, manager_pid)

@spec remove_split(integer(), pid()) :: :ok | {:error, :not_found}

Removes a split by id.

resize_split(split_id, new_dimensions, pid)

@spec resize_split(integer(), %{width: integer(), height: integer()}, pid()) ::
  {:ok, t()} | {:error, :not_found}

Resizes an existing split.

set_label(split_id, label, manager_pid)

@spec set_label(integer(), String.t(), pid()) :: {:ok, t()} | {:error, :not_found}

Sets a label on a split (for display in pane headers).

start_link(init_opts \\ [])

unbind_buffer(split_id, manager_pid)

@spec unbind_buffer(integer(), pid()) :: {:ok, t()} | {:error, :not_found}

Unbinds the buffer from a split.