public class ExternalTerminal extends LineDisciplineTerminal
LineDisciplineTerminalTerminal.MouseTracking, Terminal.Signal, Terminal.SignalHandler| Modifier and Type | Field and Description |
|---|---|
protected AtomicBoolean |
closed |
protected Object |
lock |
protected InputStream |
masterInput |
protected boolean |
paused |
protected Thread |
pumpThread |
attributes, masterOutput, size, slaveInput, slaveInputPipe, slaveOutput, slaveReader, slaveWriterbools, encoding, handlers, ints, name, status, strings, typeTYPE_DUMB, TYPE_DUMB_COLOR| Constructor and 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) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canPauseResume()
Whether this terminal supports
Terminal.pause() and Terminal.resume() calls. |
void |
close() |
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, writercheckInterrupted, echo, echo, echoSignal, encoding, enterRawMode, flush, getBooleanCapability, getKind, getName, getNumericCapability, getStatus, getStatus, getStringCapability, getType, handle, hasFocusSupport, hasMouseSupport, parseInfoCmp, puts, readMouseEvent, readMouseEvent, trackFocus, trackMouseprotected 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
IOExceptionpublic ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler) throws IOException
IOExceptionpublic ExternalTerminal(String name, String type, InputStream masterInput, OutputStream masterOutput, Charset encoding, Terminal.SignalHandler signalHandler, boolean paused) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class LineDisciplineTerminalIOExceptionpublic boolean canPauseResume()
TerminalTerminal.pause() and Terminal.resume() calls.canPauseResume in interface TerminalcanPauseResume in class AbstractTerminalTerminal.pause() and Terminal.resume() calls.Terminal.paused(),
Terminal.pause(),
Terminal.resume()public void pause()
Terminalpause in interface Terminalpause in class AbstractTerminalTerminal.resume(),
Terminal.paused()public void pause(boolean wait)
throws InterruptedException
Terminalpause in interface Terminalpause in class AbstractTerminalwait - true to wait until the terminal is actually pausedInterruptedException - if the call has been interruptedpublic void resume()
Terminalresume in interface Terminalresume in class AbstractTerminalTerminal.pause(),
Terminal.paused()public boolean paused()
Terminalpaused in interface Terminalpaused in class AbstractTerminalTerminal.pause(),
Terminal.resume()public void pump()
public Cursor getCursorPosition(IntConsumer discarded)
Terminalorg.jline.keymap.BindingReader#runMacro(String)getCursorPosition in interface TerminalgetCursorPosition in class AbstractTerminaldiscarded - a consumer receiving discarded charactersnull if cursor position reporting
is not supported or a valid cursor positionCopyright © 2020. All rights reserved.