Closeable
, Flushable
, AutoCloseable
, Terminal
public class ExternalTerminal extends LineDisciplineTerminal
LineDisciplineTerminal
Terminal.MouseTracking, Terminal.Signal, Terminal.SignalHandler
Modifier and Type | Field | Description |
---|---|---|
protected AtomicBoolean |
closed |
|
protected Object |
lock |
|
protected InputStream |
masterInput |
|
protected boolean |
paused |
|
protected Thread |
pumpThread |
attributes, masterOutput, size, slaveInput, slaveInputPipe, slaveOutput, slaveReader, slaveWriter
bools, encoding, handlers, ints, name, onClose, status, strings, type
TYPE_DUMB, TYPE_DUMB_COLOR
Constructor | Description |
---|---|
ExternalTerminal(String name,
String type,
InputStream masterInput,
OutputStream masterOutput,
Charset encoding) |
|
ExternalTerminal(String name,
String type,
InputStream masterInput,
OutputStream masterOutput,
Charset encoding,
Terminal.SignalHandler signalHandler) |
|
ExternalTerminal(String name,
String type,
InputStream masterInput,
OutputStream masterOutput,
Charset encoding,
Terminal.SignalHandler signalHandler,
boolean paused) |
|
ExternalTerminal(String name,
String type,
InputStream masterInput,
OutputStream masterOutput,
Charset encoding,
Terminal.SignalHandler signalHandler,
boolean paused,
Attributes attributes,
Size size) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
canPauseResume() |
Whether this terminal supports
Terminal.pause() and Terminal.resume() calls. |
protected void |
doClose() |
|
Cursor |
getCursorPosition(IntConsumer discarded) |
Query the terminal to report the cursor position.
|
void |
pause() |
Stop reading the input stream.
|
void |
pause(boolean wait) |
Stop reading the input stream and optionally wait for the underlying threads to finish.
|
boolean |
paused() |
Check whether the terminal is currently reading the input stream or not.
|
void |
pump() |
|
void |
resume() |
Resume reading the input stream.
|
doProcessInputByte, getAttributes, getSize, input, output, processInputByte, processInputBytes, processInputBytes, processIOException, processOutputByte, raise, reader, setAttributes, setSize, writer
checkInterrupted, close, echo, echo, echoSignal, encoding, enterRawMode, flush, getBooleanCapability, getKind, getName, getNumericCapability, getStatus, getStatus, getStringCapability, getType, handle, hasFocusSupport, hasMouseSupport, parseInfoCmp, puts, readMouseEvent, readMouseEvent, setOnClose, trackFocus, trackMouse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBufferSize, getHeight, getWidth
protected final AtomicBoolean closed
protected final InputStream masterInput
protected final Object lock
protected boolean paused
protected Thread pumpThread
public ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding) throws IOException
IOException
public ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler) throws IOException
IOException
public ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler, boolean paused) throws IOException
IOException
public ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler, boolean paused, Attributes attributes, Size size) throws IOException
IOException
protected void doClose() throws IOException
doClose
in class LineDisciplineTerminal
IOException
public boolean canPauseResume()
Terminal
Terminal.pause()
and Terminal.resume()
calls.canPauseResume
in interface Terminal
canPauseResume
in class AbstractTerminal
Terminal.pause()
and Terminal.resume()
calls.Terminal.paused()
,
Terminal.pause()
,
Terminal.resume()
public void pause()
Terminal
pause
in interface Terminal
pause
in class AbstractTerminal
Terminal.resume()
,
Terminal.paused()
public void pause(boolean wait) throws InterruptedException
Terminal
pause
in interface Terminal
pause
in class AbstractTerminal
wait
- true
to wait until the terminal is actually pausedInterruptedException
- if the call has been interruptedpublic void resume()
Terminal
resume
in interface Terminal
resume
in class AbstractTerminal
Terminal.pause()
,
Terminal.paused()
public boolean paused()
Terminal
paused
in interface Terminal
paused
in class AbstractTerminal
Terminal.pause()
,
Terminal.resume()
public void pump()
public Cursor getCursorPosition(IntConsumer discarded)
Terminal
org.jline.keymap.BindingReader#runMacro(String)
getCursorPosition
in interface Terminal
getCursorPosition
in class AbstractTerminal
discarded
- a consumer receiving discarded charactersnull
if cursor position reporting
is not supported or a valid cursor positionCopyright © 2020. All rights reserved.