Class InputrcParser
java.lang.Object
org.aesh.readline.editing.InputrcParser
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 Summary
Modifier and TypeMethodDescriptionstatic int[]Maps a key string (e.g., "M-C-a" for Meta-Control-a) to its integer array representation.static int[]mapQuoteKeys(String keys) Parse key mapping lines that start with "protected static EditModeparseInputrc(InputStream inputStream) Parses an inputrc file from the given input stream.protected static EditModeparseInputrc(InputStream inputStream, EditModeBuilder editMode) Parses an inputrc file from the given input stream using the provided EditModeBuilder.protected static voidparseLine(String line, EditModeBuilder editMode) Parses a single line from an inputrc file and applies it to the EditModeBuilder.
-
Method Details
-
parseInputrc
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
Parses an inputrc file from the given input stream using the provided EditModeBuilder.- Parameters:
inputStream- the input stream containing inputrc configurationeditMode- the EditModeBuilder to configure with parsed settings- Returns:
- the EditMode created from the inputrc configuration
-
parseLine
Parses a single line from an inputrc file and applies it to the EditModeBuilder.- Parameters:
line- the line to parseeditMode- the EditModeBuilder to configure
-
mapKeys
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
Parse key mapping lines that start with "- Parameters:
keys- that need mapping- Returns:
- int[] value of keys
-