Package org.aesh.terminal.utils
Class InfoCmp
java.lang.Object
org.aesh.terminal.utils.InfoCmp
Infocmp helper methods.
- Author:
- Guillaume Nodet
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetDefaultInfoCmp(String terminal) Get the default built-in terminal capabilities for the specified terminal type.static StringgetInfoCmp(String terminal) Get the terminal capabilities for the specified terminal type.static voidparseInfoCmp(String capabilities, Set<Capability> bools, Map<Capability, Integer> ints, Map<Capability, String> strings) Parse an infocmp capabilities string and populate the provided collections.static voidsetDefaultInfoCmp(String terminal, String caps) Set the default terminal capabilities for a terminal type.
-
Method Details
-
getInfoCmp
Get the terminal capabilities for the specified terminal type. The result is cached for subsequent calls with the same terminal type.- Parameters:
terminal- the terminal type (e.g., "xterm-256color")- Returns:
- the infocmp output for the terminal
- Throws:
IOException- if an I/O error occursInterruptedException- if the thread is interrupted
-
getDefaultInfoCmp
Get the default built-in terminal capabilities for the specified terminal type. This is used as a fallback when the infocmp command is not available.- Parameters:
terminal- the terminal type (e.g., "xterm-256color")- Returns:
- the default capabilities string, or null if not found
-
setDefaultInfoCmp
Set the default terminal capabilities for a terminal type. This will only set the value if no capabilities have been set for this terminal.- Parameters:
terminal- the terminal typecaps- the capabilities string to set
-
parseInfoCmp
public static void parseInfoCmp(String capabilities, Set<Capability> bools, Map<Capability, Integer> ints, Map<Capability, String> strings) Parse an infocmp capabilities string and populate the provided collections. Boolean capabilities are added to the bools set, integer capabilities to the ints map, and string capabilities to the strings map.- Parameters:
capabilities- the raw capabilities string from infocmpbools- set to populate with boolean capabilitiesints- map to populate with integer capabilitiesstrings- map to populate with string capabilities
-