Class InfoCmpHelper

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

public class InfoCmpHelper extends Object
Helper class for retrieving terminal capabilities from the terminfo database.
Author:
Ståle W. Pedersen
  • Method Details

    • getCurrentTranslatedCapabilityAsInts

      public static int[] getCurrentTranslatedCapabilityAsInts(String cap, int[] defaultValue)
      Get a terminal capability as an array of code points. The capability is looked up from the terminfo database for the current terminal.
      Parameters:
      cap - the capability name to look up
      defaultValue - the default value to return if the capability is not found
      Returns:
      the capability value as an int array, or the default value
    • getCurrentTranslatedCapability

      public static String getCurrentTranslatedCapability(String cap, String defaultValue)
      Get a terminal capability as a string. The capability is looked up from the terminfo database for the current terminal, which is determined by the TERM environment variable (defaults to xterm-256color).
      Parameters:
      cap - the capability name to look up
      defaultValue - the default value to return if the capability is not found
      Returns:
      the capability value as a string, or the default value