Package org.jline.terminal.impl.jni.win
Class NativeWinSysTerminal
java.lang.Object
org.jline.terminal.impl.AbstractTerminal
org.jline.terminal.impl.AbstractWindowsTerminal<Long>
org.jline.terminal.impl.jni.win.NativeWinSysTerminal
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,TerminalExt,Terminal
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jline.terminal.Terminal
Terminal.MouseTracking, Terminal.Signal, Terminal.SignalHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate static final longprivate static final longprivate char[]private char[]Fields inherited from class org.jline.terminal.impl.AbstractWindowsTerminal
ANSI_COLORS, attributes, BACKGROUND_BLUE, BACKGROUND_GREEN, BACKGROUND_INTENSITY, BACKGROUND_RED, closer, ENABLE_ECHO_INPUT, ENABLE_EXTENDED_FLAGS, ENABLE_INSERT_MODE, ENABLE_LINE_INPUT, ENABLE_MOUSE_INPUT, ENABLE_PROCESSED_INPUT, ENABLE_QUICK_EDIT_MODE, ENABLE_VIRTUAL_TERMINAL_PROCESSING, ENABLE_WINDOW_INPUT, focusTracking, FOREGROUND_BLUE, FOREGROUND_GREEN, FOREGROUND_INTENSITY, FOREGROUND_RED, inConsole, input, lock, nativeHandlers, originalInConsoleMode, originalOutConsoleMode, outConsole, output, paused, pump, reader, skipNextLf, slaveInputPipe, tracking, TYPE_WINDOWS, TYPE_WINDOWS_256_COLOR, TYPE_WINDOWS_CONEMU, TYPE_WINDOWS_VTP, writerFields inherited from class org.jline.terminal.impl.AbstractTerminal
bools, closed, currentMouseTracking, encoding, handlers, inputEncoding, ints, name, onClose, outputEncoding, palette, status, strings, typeFields inherited from interface org.jline.terminal.Terminal
TYPE_DUMB, TYPE_DUMB_COLOR -
Constructor Summary
ConstructorsConstructorDescriptionNativeWinSysTerminal(TerminalProvider provider, SystemStream systemStream, Writer writer, String name, String type, Charset encoding, boolean nativeSignals, Terminal.SignalHandler signalHandler, long inConsole, int inMode, long outConsole, int outMode) NativeWinSysTerminal(TerminalProvider provider, SystemStream systemStream, Writer writer, String name, String type, Charset encoding, Charset inputEncoding, Charset outputEncoding, boolean nativeSignals, Terminal.SignalHandler signalHandler, long inConsole, int inMode, long outConsole, int outMode) -
Method Summary
Modifier and TypeMethodDescriptionstatic NativeWinSysTerminalcreateTerminal(TerminalProvider provider, SystemStream systemStream, String name, String type, boolean ansiPassThrough, Charset encoding, boolean nativeSignals, Terminal.SignalHandler signalHandler, boolean paused) static NativeWinSysTerminalcreateTerminal(TerminalProvider provider, SystemStream systemStream, String name, String type, boolean ansiPassThrough, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, boolean nativeSignals, Terminal.SignalHandler signalHandler, boolean paused) voidprivate static booleanenableVtp(long console, int outMode) Retrieve the size of the window buffer.static longgetConsole(SystemStream systemStream) protected intgetConsoleMode(Long console) getCursorPosition(IntConsumer discarded) Query the terminal to report the cursor position.intGet the default background color for Windows terminals.intGet the default foreground color for Windows terminals.(package private) static StringgetErrorMessage(int errorCode) (package private) static StringgetSize()Retrieve the size of the visible windowstatic booleanisWindowsSystemStream(SystemStream stream) private static WriternewConsoleWriter(long console) protected booleanRead a single input event from the input buffer and process it.private voidprocessFocusEvent(boolean hasFocus) private voidprocessMouseEvent(Kernel32.MOUSE_EVENT_RECORD mouseEvent) protected voidsetConsoleMode(Long console, int mode) Methods inherited from class org.jline.terminal.impl.AbstractWindowsTerminal
canPauseResume, convertAttributeToRgb, ctrl, doClose, getAttributes, getEscapeSequence, getProvider, getRawSequence, getSystemStream, handle, hasFocusSupport, input, output, pause, pause, paused, processInputChar, processKeyEvent, pump, reader, resume, setAttributes, setSize, trackFocus, trackMouse, updateConsoleMode, writerMethods inherited from class org.jline.terminal.impl.AbstractTerminal
checkClosed, checkInterrupted, close, echo, echo, echoSignal, encoding, enterRawMode, flush, getBooleanCapability, getCurrentMouseTracking, getKind, getName, getNumericCapability, getPalette, getStatus, getStatus, getStringCapability, getType, hasMouseSupport, inputEncoding, outputEncoding, parseInfoCmp, puts, raise, readMouseEvent, readMouseEvent, readMouseEvent, readMouseEvent, setOnClose, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jline.terminal.Terminal
getHeight, getWidth, stderrEncoding, stdinEncoding, stdoutEncoding
-
Field Details
-
consoleIn
private static final long consoleIn -
consoleOut
private static final long consoleOut -
consoleErr
private static final long consoleErr -
focus
private char[] focus -
mouse
private char[] mouse
-
-
Constructor Details
-
NativeWinSysTerminal
NativeWinSysTerminal(TerminalProvider provider, SystemStream systemStream, Writer writer, String name, String type, Charset encoding, boolean nativeSignals, Terminal.SignalHandler signalHandler, long inConsole, int inMode, long outConsole, int outMode) throws IOException - Throws:
IOException
-
NativeWinSysTerminal
NativeWinSysTerminal(TerminalProvider provider, SystemStream systemStream, Writer writer, String name, String type, Charset encoding, Charset inputEncoding, Charset outputEncoding, boolean nativeSignals, Terminal.SignalHandler signalHandler, long inConsole, int inMode, long outConsole, int outMode) throws IOException - Throws:
IOException
-
-
Method Details
-
createTerminal
public static NativeWinSysTerminal createTerminal(TerminalProvider provider, SystemStream systemStream, String name, String type, boolean ansiPassThrough, Charset encoding, boolean nativeSignals, Terminal.SignalHandler signalHandler, boolean paused) throws IOException - Throws:
IOException
-
createTerminal
public static NativeWinSysTerminal createTerminal(TerminalProvider provider, SystemStream systemStream, String name, String type, boolean ansiPassThrough, Charset encoding, Charset stdinEncoding, Charset stdoutEncoding, Charset stderrEncoding, boolean nativeSignals, Terminal.SignalHandler signalHandler, boolean paused) throws IOException - Throws:
IOException
-
getConsole
-
enableVtp
private static boolean enableVtp(long console, int outMode) -
newConsoleWriter
-
isWindowsSystemStream
-
getConsoleMode
- Specified by:
getConsoleModein classAbstractWindowsTerminal<Long>
-
setConsoleMode
- Specified by:
setConsoleModein classAbstractWindowsTerminal<Long>
-
getSize
Description copied from interface:TerminalRetrieve the size of the visible window- Returns:
- the visible terminal size
- See Also:
-
getBufferSize
Description copied from interface:TerminalRetrieve the size of the window buffer. Some terminals can be configured to have a buffer size larger than the visible window size and provide scroll bars. In such cases, this method should attempt to return the size of the whole buffer. ThegetBufferSize()method can be used to avoid wrapping when using the terminal in a line editing mode, while theTerminal.getSize()method should be used when using full screen mode.- Returns:
- the terminal buffer size
- See Also:
-
processConsoleInput
Description copied from class:AbstractWindowsTerminalRead a single input event from the input buffer and process it.- Specified by:
processConsoleInputin classAbstractWindowsTerminal<Long>- Returns:
- true if new input was generated from the event
- Throws:
IOException- if anything wrong happens
-
processFocusEvent
- Throws:
IOException
-
processMouseEvent
- Throws:
IOException
-
getCursorPosition
Description copied from interface:TerminalQuery the terminal to report the cursor position. As the response is read from the input stream, some characters may be read before the cursor position is actually read. Those characters can be given back usingorg.jline.keymap.BindingReader#runMacro(String)- Specified by:
getCursorPositionin interfaceTerminal- Overrides:
getCursorPositionin classAbstractTerminal- Parameters:
discarded- a consumer receiving discarded characters- Returns:
nullif cursor position reporting is not supported or a valid cursor position
-
disableScrolling
public void disableScrolling() -
getLastErrorMessage
-
getErrorMessage
-
getDefaultForegroundColor
public int getDefaultForegroundColor()Description copied from class:AbstractWindowsTerminalGet the default foreground color for Windows terminals.- Specified by:
getDefaultForegroundColorin interfaceTerminal- Specified by:
getDefaultForegroundColorin classAbstractWindowsTerminal<Long>- Returns:
- the RGB value of the default foreground color, or -1 if not available
- See Also:
-
getDefaultBackgroundColor
public int getDefaultBackgroundColor()Description copied from class:AbstractWindowsTerminalGet the default background color for Windows terminals.- Specified by:
getDefaultBackgroundColorin interfaceTerminal- Specified by:
getDefaultBackgroundColorin classAbstractWindowsTerminal<Long>- Returns:
- the RGB value of the default background color, or -1 if not available
- See Also:
-