public abstract class AbstractWindowsTerminal<Console> extends AbstractTerminal
| Modifier and Type | Field and Description |
|---|---|
protected org.graalvm.shadowed.org.jline.terminal.Attributes |
attributes |
protected ShutdownHooks.Task |
closer |
protected static int |
ENABLE_ECHO_INPUT |
protected static int |
ENABLE_EXTENDED_FLAGS |
protected static int |
ENABLE_INSERT_MODE |
protected static int |
ENABLE_LINE_INPUT |
protected static int |
ENABLE_MOUSE_INPUT |
protected static int |
ENABLE_PROCESSED_INPUT |
protected static int |
ENABLE_QUICK_EDIT_MODE |
static int |
ENABLE_VIRTUAL_TERMINAL_PROCESSING |
protected static int |
ENABLE_WINDOW_INPUT |
protected boolean |
focusTracking |
protected Console |
inConsole |
protected NonBlockingInputStream |
input |
protected Object |
lock |
protected Map<org.graalvm.shadowed.org.jline.terminal.Terminal.Signal,Object> |
nativeHandlers |
protected int |
originalInConsoleMode |
protected int |
originalOutConsoleMode |
protected Console |
outConsole |
protected OutputStream |
output |
protected boolean |
paused |
protected Thread |
pump |
protected NonBlockingReader |
reader |
protected boolean |
skipNextLf |
protected Writer |
slaveInputPipe |
protected org.graalvm.shadowed.org.jline.terminal.Terminal.MouseTracking |
tracking |
static String |
TYPE_WINDOWS |
static String |
TYPE_WINDOWS_256_COLOR |
static String |
TYPE_WINDOWS_CONEMU |
static String |
TYPE_WINDOWS_VTP |
protected PrintWriter |
writer |
| Constructor and Description |
|---|
AbstractWindowsTerminal(org.graalvm.shadowed.org.jline.terminal.spi.TerminalProvider provider,
org.graalvm.shadowed.org.jline.terminal.spi.SystemStream systemStream,
Writer writer,
String name,
String type,
Charset encoding,
boolean nativeSignals,
org.graalvm.shadowed.org.jline.terminal.Terminal.SignalHandler signalHandler,
Console inConsole,
int inConsoleMode,
Console outConsole,
int outConsoleMode) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canPauseResume()
Whether this terminal supports
Terminal.pause() and Terminal.resume() calls. |
protected int |
ctrl(char key) |
protected void |
doClose() |
org.graalvm.shadowed.org.jline.terminal.Attributes |
getAttributes()
Returns the terminal attributes.
|
protected abstract int |
getConsoleMode(Console console) |
protected String |
getEscapeSequence(short keyCode,
int keyState) |
org.graalvm.shadowed.org.jline.terminal.spi.TerminalProvider |
getProvider()
Returns the
TerminalProvider that created this terminal
or null if the terminal was created with no provider. |
protected String |
getRawSequence(InfoCmp.Capability cap) |
org.graalvm.shadowed.org.jline.terminal.spi.SystemStream |
getSystemStream()
The underlying system stream, may be
SystemStream.Output,
SystemStream.Error, or null if this terminal is not bound
to a system stream. |
org.graalvm.shadowed.org.jline.terminal.Terminal.SignalHandler |
handle(org.graalvm.shadowed.org.jline.terminal.Terminal.Signal signal,
org.graalvm.shadowed.org.jline.terminal.Terminal.SignalHandler handler)
Registers a handler for the given
Terminal.Signal. |
boolean |
hasFocusSupport()
Returns
true if the terminal has support for focus tracking. |
InputStream |
input()
Retrieve the input stream for this terminal.
|
OutputStream |
output()
Retrieve the output stream for this terminal.
|
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.
|
protected abstract boolean |
processConsoleInput()
Read a single input event from the input buffer and process it.
|
void |
processInputChar(char c) |
protected void |
processKeyEvent(boolean isKeyDown,
short virtualKeyCode,
char ch,
int controlKeyState) |
protected void |
pump() |
NonBlockingReader |
reader()
Retrieve the
Reader for this terminal. |
void |
resume()
Resume reading the input stream.
|
void |
setAttributes(org.graalvm.shadowed.org.jline.terminal.Attributes attr)
Set the terminal attributes.
|
protected abstract void |
setConsoleMode(Console console,
int mode) |
void |
setSize(org.graalvm.shadowed.org.jline.terminal.Size size) |
boolean |
trackFocus(boolean tracking)
Enable or disable focus tracking mode.
|
boolean |
trackMouse(org.graalvm.shadowed.org.jline.terminal.Terminal.MouseTracking tracking)
Change the mouse tracking mouse.
|
protected void |
updateConsoleMode() |
PrintWriter |
writer()
Retrieve the
Writer for this terminal. |
checkInterrupted, close, echo, echo, echoSignal, encoding, enterRawMode, flush, getBooleanCapability, getCursorPosition, getKind, getName, getNumericCapability, getPalette, getStatus, getStatus, getStringCapability, getType, hasMouseSupport, parseInfoCmp, puts, raise, readMouseEvent, readMouseEvent, setOnClose, toStringpublic static final String TYPE_WINDOWS
public static final String TYPE_WINDOWS_256_COLOR
public static final String TYPE_WINDOWS_CONEMU
public static final String TYPE_WINDOWS_VTP
public static final int ENABLE_VIRTUAL_TERMINAL_PROCESSING
protected static final int ENABLE_PROCESSED_INPUT
protected static final int ENABLE_LINE_INPUT
protected static final int ENABLE_ECHO_INPUT
protected static final int ENABLE_WINDOW_INPUT
protected static final int ENABLE_MOUSE_INPUT
protected static final int ENABLE_INSERT_MODE
protected static final int ENABLE_QUICK_EDIT_MODE
protected static final int ENABLE_EXTENDED_FLAGS
protected final Writer slaveInputPipe
protected final NonBlockingInputStream input
protected final OutputStream output
protected final NonBlockingReader reader
protected final PrintWriter writer
protected final Map<org.graalvm.shadowed.org.jline.terminal.Terminal.Signal,Object> nativeHandlers
protected final ShutdownHooks.Task closer
protected final org.graalvm.shadowed.org.jline.terminal.Attributes attributes
protected final Console inConsole
protected final Console outConsole
protected final int originalInConsoleMode
protected final int originalOutConsoleMode
protected final Object lock
protected boolean paused
protected Thread pump
protected org.graalvm.shadowed.org.jline.terminal.Terminal.MouseTracking tracking
protected boolean focusTracking
protected boolean skipNextLf
public AbstractWindowsTerminal(org.graalvm.shadowed.org.jline.terminal.spi.TerminalProvider provider,
org.graalvm.shadowed.org.jline.terminal.spi.SystemStream systemStream,
Writer writer,
String name,
String type,
Charset encoding,
boolean nativeSignals,
org.graalvm.shadowed.org.jline.terminal.Terminal.SignalHandler signalHandler,
Console inConsole,
int inConsoleMode,
Console outConsole,
int outConsoleMode)
throws IOException
IOExceptionpublic org.graalvm.shadowed.org.jline.terminal.Terminal.SignalHandler handle(org.graalvm.shadowed.org.jline.terminal.Terminal.Signal signal,
org.graalvm.shadowed.org.jline.terminal.Terminal.SignalHandler handler)
org.graalvm.shadowed.org.jline.terminal.TerminalTerminal.Signal.
Note that the JVM does not easily allow catching the Terminal.Signal.QUIT signal, which causes a thread dump
to be displayed. This signal is mainly used when connecting through an SSH socket to a virtual terminal.
handle in interface org.graalvm.shadowed.org.jline.terminal.Terminalhandle in class AbstractTerminalsignal - the signal to register a handler forhandler - the handlerpublic NonBlockingReader reader()
org.graalvm.shadowed.org.jline.terminal.TerminalReader for this terminal.
This is the standard way to read input from this terminal.
The reader is non blocking.public PrintWriter writer()
org.graalvm.shadowed.org.jline.terminal.TerminalWriter for this terminal.
This is the standard way to write to this terminal.public InputStream input()
org.graalvm.shadowed.org.jline.terminal.TerminalTerminal.reader() instead.Terminal.reader()public OutputStream output()
org.graalvm.shadowed.org.jline.terminal.TerminalTerminal.writer() instead.Terminal.writer()public org.graalvm.shadowed.org.jline.terminal.Attributes getAttributes()
org.graalvm.shadowed.org.jline.terminal.TerminalTerminal.setAttributes(Attributes).public void setAttributes(org.graalvm.shadowed.org.jline.terminal.Attributes attr)
org.graalvm.shadowed.org.jline.terminal.Terminalattr - the new attributesprotected void updateConsoleMode()
protected int ctrl(char key)
public void setSize(org.graalvm.shadowed.org.jline.terminal.Size size)
protected void doClose()
throws IOException
doClose in class AbstractTerminalIOExceptionprotected void processKeyEvent(boolean isKeyDown,
short virtualKeyCode,
char ch,
int controlKeyState)
throws IOException
IOExceptionprotected String getEscapeSequence(short keyCode, int keyState)
protected String getRawSequence(InfoCmp.Capability cap)
public boolean hasFocusSupport()
org.graalvm.shadowed.org.jline.terminal.Terminaltrue if the terminal has support for focus tracking.hasFocusSupport in interface org.graalvm.shadowed.org.jline.terminal.TerminalhasFocusSupport in class AbstractTerminalTerminal.trackFocus(boolean)public boolean trackFocus(boolean tracking)
org.graalvm.shadowed.org.jline.terminal.TerminaltrackFocus in interface org.graalvm.shadowed.org.jline.terminal.TerminaltrackFocus in class AbstractTerminaltracking - whether the focus tracking mode should be enabled or nottrue if focus tracking is supportedpublic boolean canPauseResume()
org.graalvm.shadowed.org.jline.terminal.TerminalTerminal.pause() and Terminal.resume() calls.canPauseResume in interface org.graalvm.shadowed.org.jline.terminal.TerminalcanPauseResume in class AbstractTerminalTerminal.pause() and Terminal.resume() calls.Terminal.paused(),
Terminal.pause(),
Terminal.resume()public void pause()
org.graalvm.shadowed.org.jline.terminal.Terminalpause in interface org.graalvm.shadowed.org.jline.terminal.Terminalpause in class AbstractTerminalTerminal.resume(),
Terminal.paused()public void pause(boolean wait)
throws InterruptedException
org.graalvm.shadowed.org.jline.terminal.Terminalpause in interface org.graalvm.shadowed.org.jline.terminal.Terminalpause in class AbstractTerminalwait - true to wait until the terminal is actually pausedInterruptedException - if the call has been interruptedpublic void resume()
org.graalvm.shadowed.org.jline.terminal.Terminalresume in interface org.graalvm.shadowed.org.jline.terminal.Terminalresume in class AbstractTerminalTerminal.pause(),
Terminal.paused()public boolean paused()
org.graalvm.shadowed.org.jline.terminal.Terminalpaused in interface org.graalvm.shadowed.org.jline.terminal.Terminalpaused in class AbstractTerminalTerminal.pause(),
Terminal.resume()protected void pump()
public void processInputChar(char c)
throws IOException
IOExceptionpublic boolean trackMouse(org.graalvm.shadowed.org.jline.terminal.Terminal.MouseTracking tracking)
org.graalvm.shadowed.org.jline.terminal.TerminalInfoCmp.Capability.key_mouse to the input stream.
When this character sequence is detected, the Terminal.readMouseEvent() method can be
called to actually read the corresponding mouse event.trackMouse in interface org.graalvm.shadowed.org.jline.terminal.TerminaltrackMouse in class AbstractTerminaltracking - the mouse tracking modetrue if mouse tracking is supportedprotected abstract int getConsoleMode(Console console)
protected abstract void setConsoleMode(Console console, int mode)
protected abstract boolean processConsoleInput()
throws IOException
IOException - if anything wrong happenspublic org.graalvm.shadowed.org.jline.terminal.spi.TerminalProvider getProvider()
org.graalvm.shadowed.org.jline.terminal.spi.TerminalExtTerminalProvider that created this terminal
or null if the terminal was created with no provider.public org.graalvm.shadowed.org.jline.terminal.spi.SystemStream getSystemStream()
org.graalvm.shadowed.org.jline.terminal.spi.TerminalExtSystemStream.Output,
SystemStream.Error, or null if this terminal is not bound
to a system stream.