Class InputrcParser

java.lang.Object
org.aesh.readline.editing.InputrcParser

public class InputrcParser extends Object
Map key bindings to specified operation. Used when reading inputrc files. Created to map bindings like: "\M-[D": backward-char Meta-Control-h: backward-kill-word C-q: quoted-insert ... etc
Author:
Ståle W. Pedersen
  • Method Details

    • parseInputrc

      protected static EditMode parseInputrc(InputStream inputStream)
      Parses an inputrc file from the given input stream. Must be able to parse: set variablename value keyname: function-name or macro "keyseq": function-name or macro Lines starting with # are comments Lines starting with $ are conditional init constructs
      Parameters:
      inputStream - the input stream containing inputrc configuration
      Returns:
      the EditMode created from the inputrc configuration
    • parseInputrc

      protected static EditMode parseInputrc(InputStream inputStream, EditModeBuilder editMode)
      Parses an inputrc file from the given input stream using the provided EditModeBuilder.
      Parameters:
      inputStream - the input stream containing inputrc configuration
      editMode - the EditModeBuilder to configure with parsed settings
      Returns:
      the EditMode created from the inputrc configuration
    • parseLine

      protected static void parseLine(String line, EditModeBuilder editMode)
      Parses a single line from an inputrc file and applies it to the EditModeBuilder.
      Parameters:
      line - the line to parse
      editMode - the EditModeBuilder to configure
    • mapKeys

      public static int[] mapKeys(String keys)
      Maps a key string (e.g., "M-C-a" for Meta-Control-a) to its integer array representation.
      Parameters:
      keys - the key string to map
      Returns:
      the integer array representation of the key sequence
    • mapQuoteKeys

      public static int[] mapQuoteKeys(String keys)
      Parse key mapping lines that start with "
      Parameters:
      keys - that need mapping
      Returns:
      int[] value of keys