public interface Terminal extends Closeable, Flushable
Closeable.close()
method
in order to restore their original state.Modifier and Type | Interface and Description |
---|---|
static class |
Terminal.MouseTracking |
static class |
Terminal.Signal |
static interface |
Terminal.SignalHandler |
Modifier and Type | Field and Description |
---|---|
static String |
TYPE_DUMB
Type used for dumb terminals.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canPauseResume()
|
boolean |
echo() |
boolean |
echo(boolean echo) |
Charset |
encoding()
|
Attributes |
enterRawMode() |
void |
flush() |
Attributes |
getAttributes() |
boolean |
getBooleanCapability(InfoCmp.Capability capability) |
Cursor |
getCursorPosition(IntConsumer discarded)
Query the terminal to report the cursor position.
|
default int |
getHeight() |
String |
getName() |
Integer |
getNumericCapability(InfoCmp.Capability capability) |
Size |
getSize() |
String |
getStringCapability(InfoCmp.Capability capability) |
String |
getType() |
default int |
getWidth() |
Terminal.SignalHandler |
handle(Terminal.Signal signal,
Terminal.SignalHandler handler) |
boolean |
hasFocusSupport()
Returns
true if the terminal has support for focus tracking. |
boolean |
hasMouseSupport()
Returns
true if the terminal has support for mouse. |
InputStream |
input() |
OutputStream |
output() |
void |
pause()
Stop reading the input stream.
|
boolean |
paused()
Check whether the terminal is currently reading the input stream or not.
|
boolean |
puts(InfoCmp.Capability capability,
Object... params) |
void |
raise(Terminal.Signal signal) |
NonBlockingReader |
reader() |
MouseEvent |
readMouseEvent()
Read a MouseEvent from the terminal input stream.
|
MouseEvent |
readMouseEvent(IntSupplier reader)
Read a MouseEvent from the given input stream.
|
void |
resume()
Resume reading the input stream.
|
void |
setAttributes(Attributes attr) |
void |
setSize(Size size) |
boolean |
trackFocus(boolean tracking)
Enable or disable focus tracking mode.
|
boolean |
trackMouse(Terminal.MouseTracking tracking)
Change the mouse tracking mouse.
|
PrintWriter |
writer() |
static final String TYPE_DUMB
String getName()
Terminal.SignalHandler handle(Terminal.Signal signal, Terminal.SignalHandler handler)
void raise(Terminal.Signal signal)
NonBlockingReader reader()
PrintWriter writer()
Charset encoding()
InputStream input()
OutputStream output()
boolean canPauseResume()
boolean paused()
Attributes enterRawMode()
boolean echo()
boolean echo(boolean echo)
Attributes getAttributes()
void setAttributes(Attributes attr)
Size getSize()
void setSize(Size size)
default int getWidth()
default int getHeight()
String getType()
boolean puts(InfoCmp.Capability capability, Object... params)
boolean getBooleanCapability(InfoCmp.Capability capability)
Integer getNumericCapability(InfoCmp.Capability capability)
String getStringCapability(InfoCmp.Capability capability)
Cursor getCursorPosition(IntConsumer discarded)
org.jline.keymap.BindingReader#runMacro(String)
.discarded
- a consumer receiving discarded charactersnull
if cursor position reporting
is not supported or a valid cursor positionboolean hasMouseSupport()
true
if the terminal has support for mouse.trackMouse(MouseTracking)
boolean trackMouse(Terminal.MouseTracking tracking)
InfoCmp.Capability.key_mouse
to the input stream.
When this character sequence is detected, the readMouseEvent()
method can be
called to actually read the corresponding mouse event.tracking
- the mouse tracking modetrue
if mouse tracking is supportedMouseEvent readMouseEvent()
InfoCmp.Capability.key_mouse
in the stream immediately before reading the event.trackMouse(MouseTracking)
MouseEvent readMouseEvent(IntSupplier reader)
reader
- the input supplierboolean hasFocusSupport()
true
if the terminal has support for focus tracking.trackFocus(boolean)
boolean trackFocus(boolean tracking)
tracking
- whether the focus tracking mode should be enabled or nottrue
if focus tracking is supportedCopyright © 2018 JBoss by Red Hat. All rights reserved.