public class ExternalTerminal extends LineDisciplineTerminal
LineDisciplineTerminal
Terminal.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, slaveWriter
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) |
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) |
boolean |
paused()
Check whether the terminal is currently reading the input stream or not.
|
void |
pump() |
void |
resume()
Resume reading the input stream.
|
getAttributes, getSize, input, output, processInputByte, processOutputByte, raise, reader, setAttributes, setSize, writer
checkInterrupted, echo, echo, echoSignal, encoding, enterRawMode, flush, getBooleanCapability, getKind, getName, getNumericCapability, getStringCapability, getType, handle, hasFocusSupport, hasMouseSupport, parseInfoCmp, puts, readMouseEvent, readMouseEvent, trackFocus, trackMouse
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 void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
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
pause
in class AbstractTerminal
InterruptedException
public 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 © 2018 JBoss by Red Hat. All rights reserved.