Class InputRC


  • public final class InputRC
    extends java.lang.Object
    Handles inputrc configuration files for JLine.

    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:
    LineReader.INPUT_RC_FILE_NAME, LineReader.getKeyMaps()
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void configure​(LineReader reader, java.io.InputStream is)
      Configures a LineReader from an inputrc file.
      static void configure​(LineReader reader, java.io.Reader r)
      Configures a LineReader from an inputrc file.
      static void configure​(LineReader reader, java.net.URL url)
      Configures a LineReader from an inputrc file at the specified URL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • configure

        public static void configure​(LineReader reader,
                                     java.net.URL url)
                              throws java.io.IOException
        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 configure
        url - the URL of the inputrc file
        Throws:
        java.io.IOException - if an I/O error occurs while reading the configuration
      • configure

        public static void configure​(LineReader reader,
                                     java.io.InputStream is)
                              throws java.io.IOException
        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 configure
        is - the input stream containing the configuration
        Throws:
        java.io.IOException - if an I/O error occurs while reading the configuration
      • configure

        public static void configure​(LineReader reader,
                                     java.io.Reader r)
                              throws java.io.IOException
        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 configure
        r - the reader containing the configuration
        Throws:
        java.io.IOException - if an I/O error occurs while reading the configuration