Raxol.Terminal.Config (Raxol v0.5.0)
View SourceHandles terminal settings and behavior, including:
- Terminal dimensions
- Color settings
- Input handling
- Terminal state management
- Configuration validation
- Configuration persistence
Summary
Functions
Gets the current color settings.
Gets the current terminal dimensions.
Gets the current input handling settings.
Gets the current terminal mode settings.
Gets the current performance settings.
Gets the current style settings.
Lists all saved configurations.
Loads a configuration from persistent storage.
Merges a map of options with the current configuration. Validates the options before merging.
Creates a new terminal configuration with default values.
Creates a new terminal configuration with custom dimensions.
Saves the configuration to persistent storage.
Updates the color settings.
Updates the terminal dimensions.
Updates the input handling settings.
Updates the terminal mode settings.
Updates the performance settings.
Updates the style settings.
Updates the terminal configuration with validation.
Validates a configuration map. Checks for required fields and valid values.
Types
@type t() :: %Raxol.Terminal.Config{ colors: map(), height: non_neg_integer(), input: map(), mode: map(), performance: map(), styles: map(), version: non_neg_integer(), width: non_neg_integer() }
Functions
Gets the current color settings.
Parameters
config
- The current configuration
Returns
A map containing the current color settings.
Gets the current terminal dimensions.
Parameters
config
- The current configuration
Returns
A tuple {width, height}
with the current dimensions.
Gets the current input handling settings.
Parameters
config
- The current configuration
Returns
A map containing the current input settings.
Gets the current terminal mode settings.
Parameters
config
- The current configuration
Returns
A map containing the current mode settings.
Gets the current performance settings.
Parameters
config
- The current configuration
Returns
A map containing the current performance settings.
Gets the current style settings.
Parameters
config
- The current configuration
Returns
A map containing the current style settings.
Lists all saved configurations.
Loads a configuration from persistent storage.
Merges a map of options with the current configuration. Validates the options before merging.
Parameters
config
- The current configurationopts
- A map of options to merge
Returns
The updated configuration with merged options.
@spec new() :: t()
Creates a new terminal configuration with default values.
Returns
A new Raxol.Terminal.Config.t/0
struct with default values.
Creates a new terminal configuration with custom dimensions.
Parameters
width
- The terminal width in charactersheight
- The terminal height in characters
Returns
A new Raxol.Terminal.Config.t/0
struct with the specified dimensions.
Saves the configuration to persistent storage.
Updates the color settings.
Parameters
config
- The current configurationcolors
- A map of color settings to update
Returns
The updated configuration with new color settings.
Updates the terminal dimensions.
Parameters
config
- The current configurationwidth
- The new terminal widthheight
- The new terminal height
Returns
The updated configuration with new dimensions.
Updates the input handling settings.
Parameters
config
- The current configurationinput
- A map of input settings to update
Returns
The updated configuration with new input settings.
Updates the terminal mode settings.
Parameters
config
- The current configurationmode
- A map of mode settings to update
Returns
The updated configuration with new mode settings.
Updates the performance settings.
Parameters
config
- The current configurationperformance
- A map of performance settings to update
Returns
The updated configuration with new performance settings.
Updates the style settings.
Parameters
config
- The current configurationstyles
- A map of style settings to update
Returns
The updated configuration with new style settings.
Updates the terminal configuration with validation.
Validates a configuration map. Checks for required fields and valid values.
Parameters
config
- The configuration to validate
Returns
:ok
if the configuration is valid, {:error, reason}
otherwise.