Package jline

Class WindowsTerminal

  • All Implemented Interfaces:
    Terminal
    Direct Known Subclasses:
    AnsiWindowsTerminal

    public class WindowsTerminal
    extends TerminalSupport
    Terminal implementation for Microsoft Windows. Terminal initialization in init() is accomplished by extracting the jline_version.dll, saving it to the system temporary directoy (determined by the setting of the java.io.tmpdir System property), loading the library, and then calling the Win32 APIs SetConsoleMode and GetConsoleMode to disable character echoing.

    By default, the wrapInIfNeeded(java.io.InputStream) method will attempt to test to see if the specified InputStream is System.in or a wrapper around FileDescriptor.in, and if so, will bypass the character reading to directly invoke the readc() method in the JNI library. This is so the class can read special keys (like arrow keys) which are otherwise inaccessible via the System.in stream. Using JNI reading can be bypassed by setting the jline.WindowsTerminal.directConsole system property to false.

    Since:
    2.0
    Author:
    Marc Prud'hommeaux, Jason Dillon
    • Field Detail

      • DIRECT_CONSOLE

        public static final java.lang.String DIRECT_CONSOLE
      • ANSI

        public static final java.lang.String ANSI
    • Constructor Detail

      • WindowsTerminal

        public WindowsTerminal()
                        throws java.lang.Exception
        Throws:
        java.lang.Exception