public class

WindowsTerminal

extends TerminalSupport
java.lang.Object
   ↳ jline.TerminalSupport
     ↳ jline.WindowsTerminal
Known Direct Subclasses

Class Overview

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 in or a wrapper around 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 in stream. Using JNI reading can be bypassed by setting the jline.WindowsTerminal.directConsole system property to false.

Summary

Nested Classes
enum WindowsTerminal.ConsoleMode Console mode

Constants copied wincon.h

[Expand]
Inherited Constants
From class jline.TerminalSupport
Fields
public static final String ANSI
public static final String DIRECT_CONSOLE
Public Constructors
WindowsTerminal()
Public Methods
Boolean getDirectConsole()
Whether or not to allow the use of the JNI console interaction.
int getHeight()
String getOutputEncoding()
int getWidth()
void init()
void restore()
Restore the original terminal configuration, which can be used when shutting down the console reader.
void setDirectConsole(boolean flag)
Whether or not to allow the use of the JNI console interaction.
void setEchoEnabled(boolean enabled)
InputStream wrapInIfNeeded(InputStream in)
When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.
Protected Methods
boolean isSystemIn(InputStream in)
[Expand]
Inherited Methods
From class jline.TerminalSupport
From class java.lang.Object
From interface jline.Terminal

Fields

public static final String ANSI

public static final String DIRECT_CONSOLE

Public Constructors

public WindowsTerminal ()

Throws
Exception

Public Methods

public Boolean getDirectConsole ()

Whether or not to allow the use of the JNI console interaction.

public int getHeight ()

public String getOutputEncoding ()

public int getWidth ()

public void init ()

Throws
Exception

public void restore ()

Restore the original terminal configuration, which can be used when shutting down the console reader. The ConsoleReader cannot be used after calling this method.

Throws
Exception

public void setDirectConsole (boolean flag)

Whether or not to allow the use of the JNI console interaction.

public void setEchoEnabled (boolean enabled)

public InputStream wrapInIfNeeded (InputStream in)

When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.

Throws
IOException

Protected Methods

protected boolean isSystemIn (InputStream in)

Throws
IOException