Raxol.Terminal.Tab.UnifiedTab (Raxol v0.5.0)
View SourceProvides unified tab management functionality for the terminal emulator. This module handles tab creation, switching, state management, and configuration.
Summary
Functions
Returns a specification to start this module under a supervisor.
Cleans up resources.
Closes a tab and its associated windows.
Creates a new tab with the given configuration.
Gets the active tab ID.
Gets the state of a specific tab.
Gets the list of all tabs.
Moves a tab to a new position.
Sets the active tab.
Starts the tab manager with the given options.
Updates the tab manager configuration.
Updates the configuration of a specific tab.
Types
@type tab_config() :: %{ optional(:name) => String.t(), optional(:icon) => String.t(), optional(:color) => String.t(), optional(:position) => non_neg_integer(), optional(:state) => tab_state() }
@type tab_id() :: non_neg_integer()
@type tab_state() :: :active | :inactive | :hidden
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec cleanup() :: :ok
Cleans up resources.
Closes a tab and its associated windows.
Creates a new tab with the given configuration.
@spec get_active_tab() :: {:ok, tab_id()} | {:error, :no_active_tab}
Gets the active tab ID.
Gets the state of a specific tab.
@spec get_tabs() :: [tab_id()]
Gets the list of all tabs.
@spec move_tab(tab_id(), non_neg_integer()) :: :ok | {:error, term()}
Moves a tab to a new position.
Sets the active tab.
@spec start_link(map()) :: GenServer.on_start()
Starts the tab manager with the given options.
@spec update_config(map()) :: :ok
Updates the tab manager configuration.
@spec update_tab_config(tab_id(), tab_config()) :: :ok | {:error, term()}
Updates the configuration of a specific tab.