Raxol.Terminal.Config (Raxol v0.4.0)
View SourceTerminal configuration system.
This module is the main entry point for terminal configuration, providing a simplified interface to the underlying configuration modules.
Summary
Functions
Applies a configuration to the terminal.
Applies a partial configuration update to the terminal.
Returns the configuration schema.
Detects terminal capabilities based on the environment.
Generates a default configuration based on terminal capabilities.
Gets the current terminal configuration.
Returns the type information for a specific configuration path.
Lists all available terminal configuration profiles.
Loads terminal configuration from the default path.
Loads terminal configuration from the specified path.
Loads a specific terminal configuration profile.
Merges configuration options into an existing configuration map.
Creates an optimized configuration based on detected capabilities.
Resets terminal configuration to default values.
Saves terminal configuration to the default path.
Saves terminal configuration to the specified path.
Saves the current configuration as a profile.
Validates a complete terminal configuration.
Validates a specific configuration value against its schema.
Functions
Applies a configuration to the terminal.
Parameters
config
- The configuration to applyterminal_pid
- The PID of the terminal process (optional)
Returns
{:ok, applied_config}
or {:error, reason}
Applies a partial configuration update to the terminal.
Parameters
partial_config
- The partial configuration to applyterminal_pid
- The PID of the terminal process (optional)
Returns
{:ok, updated_config}
or {:error, reason}
Returns the configuration schema.
Returns
A map defining the structure and types for all configuration options.
Detects terminal capabilities based on the environment.
Returns
A map of detected capabilities.
Generates a default configuration based on terminal capabilities.
Returns
A map containing default configuration values for all settings.
Gets the current terminal configuration.
Parameters
terminal_pid
- The PID of the terminal process (optional)
Returns
The current terminal configuration.
Returns the type information for a specific configuration path.
Parameters
path
- A list of keys representing the path to the configuration value
Returns
A tuple with type information or nil if the path doesn't exist
Lists all available terminal configuration profiles.
Returns
A list of profile names.
Loads terminal configuration from the default path.
Returns
{:ok, config}
or {:error, reason}
Loads terminal configuration from the specified path.
Parameters
path
- The file path to load from
Returns
{:ok, config}
or {:error, reason}
Loads a specific terminal configuration profile.
Parameters
name
- The name of the profile to load
Returns
{:ok, config}
or {:error, reason}
Merges configuration options into an existing configuration map.
Delegates to Raxol.Terminal.Config.Utils.merge_opts/2
.
Creates an optimized configuration based on detected capabilities.
Returns
An optimized configuration for the current terminal.
Resets terminal configuration to default values.
Parameters
terminal_pid
- The PID of the terminal process (optional)optimize
- Whether to optimize for detected capabilities (default: true)
Returns
{:ok, default_config}
or {:error, reason}
Saves terminal configuration to the default path.
Parameters
config
- The configuration to save
Returns
:ok
or {:error, reason}
Saves terminal configuration to the specified path.
Parameters
config
- The configuration to savepath
- The file path to save to
Returns
:ok
or {:error, reason}
Saves the current configuration as a profile.
Parameters
name
- The name of the profile to saveconfig
- The configuration to save
Returns
:ok
or {:error, reason}
Validates a complete terminal configuration.
Parameters
config
- The configuration to validate
Returns
{:ok, validated_config}
or {:error, reason}
Validates a specific configuration value against its schema.
Parameters
path
- A list of keys representing the path to the configuration valuevalue
- The value to validate
Returns
{:ok, validated_value}
or {:error, reason}