Scrollable
, InputProvider
, ExtendedTerminal
, Terminal
, Closeable
, AutoCloseable
public class CygwinTerminal extends UnixLikeTTYTerminal
NOTE: This class is experimental and does not fully work! Some of the operations, like disabling echo and changing cbreak seems to be impossible to do without resorting to native code. Running "stty raw" before starting the JVM will improve compatibility.
NOTE: This class will try to find Cygwin by scanning the directories on java.library.path, but you can also tell it where Cygwin is installed by setting the CYGWIN_HOME environment variable.
UnixLikeTerminal.CtrlCBehaviour
Constructor | Description |
---|---|
CygwinTerminal(InputStream terminalInput,
OutputStream terminalOutput,
Charset terminalCharset) |
Creates a new CygwinTerminal based off input and output streams and a character set to use
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
acquire() |
Effectively taking over the terminal and enabling it for Lanterna to use, by turning off echo and canonical mode,
adding resize listeners and optionally trap unix signals.
|
protected TerminalSize |
findTerminalSize() |
|
protected String |
runSTTYCommand(String... parameters) |
addResizeListener, newTextGraphics, onResized, onResized, removeResizeListener
clearScreen, deiconify, disableSGR, enableSGR, enterPrivateMode, exitPrivateMode, getCursorPosition, getDefaultKeyDecodingProfile, getTerminalSize, iconify, maximize, popTitle, pushTitle, resetColorAndSGR, scrollLines, setBackgroundColor, setCursorPosition, setCursorPosition, setCursorVisible, setForegroundColor, setMouseCaptureMode, setTerminalSize, setTitle, unmaximize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addKeyDecodingProfile, bell, enquireTerminal, flush, getCharset, getInputDecoder, putCharacter, translateCharacter, writeToTerminal
addResizeListener, bell, enquireTerminal, flush, newTextGraphics, putCharacter, removeResizeListener
close, getTerminalCtrlCBehaviour, pollInput, readInput
canonicalMode, exec, keyEchoEnabled, keyStrokeSignalsEnabled, registerTerminalResizeListener, restoreTerminalSettings, saveTerminalSettings
public CygwinTerminal(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset) throws IOException
terminalInput
- Input stream to read input fromterminalOutput
- Output stream to write output toterminalCharset
- Character set to use when writing to the output streamIOException
- If there was an I/O error when trying to initialize the class and setup the terminalprotected TerminalSize findTerminalSize() throws IOException
findTerminalSize
in class ANSITerminal
IOException
protected String runSTTYCommand(String... parameters) throws IOException
runSTTYCommand
in class UnixLikeTTYTerminal
IOException
protected void acquire() throws IOException
UnixLikeTerminal
UnixLikeTerminal
acquire
in class UnixLikeTTYTerminal
IOException
- If there was an I/O errorCopyright © 2020. All rights reserved.