Class InfoCmp

java.lang.Object
org.aesh.terminal.utils.InfoCmp

public final class InfoCmp extends Object
Infocmp helper methods.
Author:
Guillaume Nodet
  • Method Details

    • getInfoCmp

      public static String getInfoCmp(String terminal) throws IOException, InterruptedException
      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 occurs
      InterruptedException - if the thread is interrupted
    • getDefaultInfoCmp

      public static String getDefaultInfoCmp(String terminal)
      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

      public static void setDefaultInfoCmp(String terminal, String caps)
      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 type
      caps - 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 infocmp
      bools - set to populate with boolean capabilities
      ints - map to populate with integer capabilities
      strings - map to populate with string capabilities