public class JLineConsole extends PlainConsole
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CTRL_Z
The ctrl-z character String.
|
protected PyObject |
pre_input_hook
Not currently set by
readline.set_pre_input_hook . |
jline.console.ConsoleReader |
reader
Main interface to JLine.
|
protected PyObject |
startup_hook
Callable object set by
readline.set_startup_hook . |
encoding, encodingCharset
Constructor and Description |
---|
JLineConsole(java.lang.String encoding)
Construct an instance of the console class specifying the character encoding.
|
Modifier and Type | Method and Description |
---|---|
jline.console.ConsoleReader |
getReader() |
PyObject |
getStartupHook() |
void |
install()
Complete initialization and (optionally) install a stream object with line-editing as the
replacement for
System.in . |
void |
setStartupHook(PyObject hook)
Sets the startup hook (called prior to each readline)
|
getEncoding, getEncodingCharset, uninstall
public jline.console.ConsoleReader reader
protected PyObject startup_hook
readline.set_startup_hook
.protected PyObject pre_input_hook
readline.set_pre_input_hook
. Why not?protected static final java.lang.String CTRL_Z
public JLineConsole(java.lang.String encoding)
Most of the initialisation is deferred to the install()
method so that any prior
console can uninstall itself before we change system console settings and
System.in
.
encoding
- name of a supported encoding or null
for
Charset.defaultCharset()
public void install()
System.in
.
This implementation overrides that by setting System.in
to a
FilterInputStream
object that wraps JLine, and System.out
with a layer that buffers incomplete lines for use as the console prompt.
install
in interface Console
install
in class PlainConsole
public jline.console.ConsoleReader getReader()
public PyObject getStartupHook()
public void setStartupHook(PyObject hook)