Class UnixTerminal
java.lang.Object
jline.TerminalSupport
jline.UnixTerminal
- Direct Known Subclasses:
NoInterruptUnixTerminal
Terminal that is used for unix platforms. Terminal initialization
is handled by issuing the stty command against the
/dev/tty file to disable character echoing and enable
character input. All known unix systems (including
Linux and Macintosh OS X) support the stty), so this
implementation should work for an reasonable POSIX system.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate final TerminalLineSettingsprivate final StringFields inherited from class TerminalSupport
DEFAULT_HEIGHT, DEFAULT_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidbooleangetBooleanCapability(String capability) intReturns the value of stty rows>/tt> param.getNumericCapability(String capability) getStringCapability(String capability) intgetWidth()Returns the value of stty columns param.booleanDefaults to true which was the behaviour before this method was added.voidinit()Remove line-buffered input by invoking "stty -icanon min 1" against the current terminal.private voidvoidrestore()Restore the original terminal configuration, which can be used when shutting down the console reader.voidsetEchoEnabled(boolean enabled) Methods inherited from class TerminalSupport
getOutputEncoding, isAnsiSupported, isEchoEnabled, isSupported, reset, setAnsiSupported, wrapInIfNeeded, wrapOutIfNeededMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Terminal
getOutputEncoding, isAnsiSupported, isEchoEnabled, isSupported, reset, wrapInIfNeeded, wrapOutIfNeeded
-
Field Details
-
settings
-
type
-
intr
-
lnext
-
bools
-
ints
-
strings
-
-
Constructor Details
-
UnixTerminal
-
UnixTerminal
-
UnixTerminal
-
-
Method Details
-
getSettings
-
init
-
restore
Restore the original terminal configuration, which can be used when shutting down the console reader. The ConsoleReader cannot be used after calling this method.- Specified by:
restorein interfaceTerminal- Overrides:
restorein classTerminalSupport- Throws:
Exception
-
getWidth
public int getWidth()Returns the value of stty columns param.- Specified by:
getWidthin interfaceTerminal- Overrides:
getWidthin classTerminalSupport
-
getHeight
public int getHeight()Returns the value of stty rows>/tt> param.- Specified by:
getHeightin interfaceTerminal- Overrides:
getHeightin classTerminalSupport
-
hasWeirdWrap
public boolean hasWeirdWrap()Description copied from class:TerminalSupportDefaults to true which was the behaviour before this method was added.- Specified by:
hasWeirdWrapin interfaceTerminal- Overrides:
hasWeirdWrapin classTerminalSupport
-
setEchoEnabled
public void setEchoEnabled(boolean enabled) - Specified by:
setEchoEnabledin interfaceTerminal- Overrides:
setEchoEnabledin classTerminalSupport
-
disableInterruptCharacter
public void disableInterruptCharacter()- Specified by:
disableInterruptCharacterin interfaceTerminal- Overrides:
disableInterruptCharacterin classTerminalSupport
-
enableInterruptCharacter
public void enableInterruptCharacter()- Specified by:
enableInterruptCharacterin interfaceTerminal- Overrides:
enableInterruptCharacterin classTerminalSupport
-
disableLitteralNextCharacter
public void disableLitteralNextCharacter() -
enableLitteralNextCharacter
public void enableLitteralNextCharacter() -
getBooleanCapability
- Specified by:
getBooleanCapabilityin interfaceTerminal2
-
getNumericCapability
- Specified by:
getNumericCapabilityin interfaceTerminal2
-
getStringCapability
- Specified by:
getStringCapabilityin interfaceTerminal2
-
parseInfoCmp
private void parseInfoCmp()
-