- All Implemented Interfaces:
Scrollable
,InputProvider
,ExtendedTerminal
,Terminal
,Closeable
,AutoCloseable
This class extends UnixLikeTerminal and implements the Unix-specific parts.
If you need to have Lanterna to call stty at a different location, you'll need to
subclass this and override getSTTYCommand()
.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.googlecode.lanterna.terminal.ansi.UnixLikeTerminal
UnixLikeTerminal.CtrlCBehaviour
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a UnixTerminal with default settings, using System.in and System.out for input/output, using the default character set on the system as the encoding and trap ctrl+c signal instead of killing the application.private
UnixTerminal
(File terminalDevice, InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset, UnixLikeTerminal.CtrlCBehaviour terminalCtrlCBehaviour) UnixTerminal
(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset) Creates a UnixTerminal using a specified input stream, output stream and character set.UnixTerminal
(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset, UnixLikeTerminal.CtrlCBehaviour terminalCtrlCBehaviour) Creates a UnixTerminal using a specified input stream, output stream and character set, with a custom size querier instead of using the default one. -
Method Summary
Methods inherited from class com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal
acquire, canonicalMode, exec, keyEchoEnabled, keyStrokeSignalsEnabled, registerTerminalResizeListener, restoreTerminalSettings, runSTTYCommand, saveTerminalSettings
Methods inherited from class com.googlecode.lanterna.terminal.ansi.UnixLikeTerminal
close, getTerminalCtrlCBehaviour, pollInput, readInput
Methods inherited from class com.googlecode.lanterna.terminal.ansi.ANSITerminal
clearScreen, deiconify, disableSGR, enableSGR, enterPrivateMode, exitPrivateMode, findTerminalSize, getCursorPosition, getDefaultKeyDecodingProfile, getTerminalSize, iconify, isInPrivateMode, maximize, popTitle, pushTitle, reportPosition, resetColorAndSGR, restoreCursorPosition, saveCursorPosition, scrollLines, setBackgroundColor, setCursorPosition, setCursorPosition, setCursorVisible, setForegroundColor, setMouseCaptureMode, setTerminalSize, setTitle, unmaximize
Methods inherited from class com.googlecode.lanterna.terminal.ansi.StreamBasedTerminal
bell, enquireTerminal, flush, getCharset, getInputDecoder, putCharacter, putString, resetMemorizedCursorPosition, translateCharacter, waitForCursorPositionReport, writeToTerminal
Methods inherited from class com.googlecode.lanterna.terminal.AbstractTerminal
addResizeListener, newTextGraphics, onResized, onResized, removeResizeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.googlecode.lanterna.terminal.Terminal
addResizeListener, bell, enquireTerminal, flush, newTextGraphics, putCharacter, putString, removeResizeListener
-
Constructor Details
-
UnixTerminal
Creates a UnixTerminal with default settings, using System.in and System.out for input/output, using the default character set on the system as the encoding and trap ctrl+c signal instead of killing the application.- Throws:
IOException
- If there was an I/O error initializing the terminal
-
UnixTerminal
public UnixTerminal(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset) throws IOException Creates a UnixTerminal using a specified input stream, output stream and character set. Ctrl+c signal will be trapped instead of killing the application.- Parameters:
terminalInput
- Input stream to read terminal input fromterminalOutput
- Output stream to write terminal output toterminalCharset
- Character set to use when converting characters to bytes- Throws:
IOException
- If there was an I/O error initializing the terminal
-
UnixTerminal
public UnixTerminal(InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset, UnixLikeTerminal.CtrlCBehaviour terminalCtrlCBehaviour) throws IOException Creates a UnixTerminal using a specified input stream, output stream and character set, with a custom size querier instead of using the default one. This way you can override size detection (if you want to force the terminal to a fixed size, for example). You also choose how you want ctrl+c key strokes to be handled.- Parameters:
terminalInput
- Input stream to read terminal input fromterminalOutput
- Output stream to write terminal output toterminalCharset
- Character set to use when converting characters to bytesterminalCtrlCBehaviour
- Special settings on how the terminal will behave, seeUnixTerminalMode
for more details- Throws:
IOException
- If there was an I/O error initializing the terminal
-
UnixTerminal
private UnixTerminal(File terminalDevice, InputStream terminalInput, OutputStream terminalOutput, Charset terminalCharset, UnixLikeTerminal.CtrlCBehaviour terminalCtrlCBehaviour) throws IOException - Throws:
IOException
-