Raxol.System.TerminalPlatform (Raxol v0.5.0)
View SourceTerminal-specific platform features and compatibility checks.
This module provides detailed information about terminal capabilities, feature support, and compatibility across different platforms and terminal emulators.
Summary
Functions
Returns the list of all supported terminal features.
Returns detailed information about the current terminal's capabilities.
Checks if a specific terminal feature is supported.
Types
Functions
@spec get_supported_features() :: [terminal_feature()]
Returns the list of all supported terminal features.
Returns
List of supported feature atoms.
Examples
iex> TerminalPlatform.get_supported_features()
[:true_color, :unicode, :mouse, :clipboard]
@spec get_terminal_capabilities() :: map()
Returns detailed information about the current terminal's capabilities.
Returns
A map containing terminal capabilities including:
:name
- Terminal name/type:version
- Terminal version if available:features
- List of supported features:colors
- Color support information:unicode
- Unicode support details:input
- Input capabilities:output
- Output capabilities
Examples
iex> TerminalPlatform.get_terminal_capabilities()
%{
name: "iTerm2",
version: "3.5.0",
features: [:true_color, :unicode, :mouse, :clipboard],
colors: %{
basic: true,
true_color: true,
palette: "default"
},
unicode: %{
support: true,
width: :ambiguous,
emoji: true
},
input: %{
mouse: true,
bracketed_paste: true,
focus: true
},
output: %{
title: true,
bell: true,
alternate_screen: true
}
}
@spec supports_feature?(terminal_feature()) :: boolean()
Checks if a specific terminal feature is supported.
Parameters
feature
- Feature to check for support
Returns
true
- Feature is supportedfalse
- Feature is not supported
Examples
iex> TerminalPlatform.supports_feature?(:true_color)
true