Class InputRC
This class provides functionality for parsing and applying inputrc configuration files, which are used to customize key bindings and other behavior of the LineReader. The format is compatible with GNU Readline's inputrc files.
Key features include:
- Binding keys to functions or macros
- Setting variables that control LineReader behavior
- Conditional configuration based on terminal type
The configuration is typically loaded from a file specified by the
LineReader.INPUT_RC_FILE_NAME variable, but can also
be loaded from any input stream.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigure(LineReader reader, InputStream is) Configures a LineReader from an inputrc file.static voidconfigure(LineReader reader, Reader r) Configures a LineReader from an inputrc file.static voidconfigure(LineReader reader, URL url) Configures a LineReader from an inputrc file at the specified URL.private static chargetKeyFromName(String name) private voidparse(BufferedReader br) (package private) static voidsetVar(LineReader reader, String key, String val) Sets a variable in the LineReader.private static StringtranslateQuoted(String keySeq)
-
Field Details
-
reader
-
-
Constructor Details
-
InputRC
-
-
Method Details
-
configure
Configures a LineReader from an inputrc file at the specified URL.This method opens the URL and passes the resulting input stream to
configure(LineReader, InputStream).- Parameters:
reader- the LineReader to configureurl- the URL of the inputrc file- Throws:
IOException- if an I/O error occurs while reading the configuration
-
configure
Configures a LineReader from an inputrc file.This method reads configuration commands from the provided input stream and passes them to
configure(LineReader, Reader).- Parameters:
reader- the LineReader to configureis- the input stream containing the configuration- Throws:
IOException- if an I/O error occurs while reading the configuration
-
configure
Configures a LineReader from an inputrc file.This method reads configuration commands from the provided reader and applies them to the LineReader. The format of the input is compatible with GNU Readline's inputrc files.
- Parameters:
reader- the LineReader to configurer- the reader containing the configuration- Throws:
IOException- if an I/O error occurs while reading the configuration
-
parse
- Throws:
IOExceptionIllegalArgumentException
-
translateQuoted
-
getKeyFromName
-
setVar
Sets a variable in the LineReader.This method handles special cases for certain variables, such as the keymap, and options that can be turned on or off.
- Parameters:
reader- the LineReader to modifykey- the name of the variable to setval- the value to set
-