Package jline
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 String
private String
private final TerminalLineSettings
private final String
Fields inherited from class jline.TerminalSupport
DEFAULT_HEIGHT, DEFAULT_WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
boolean
getBooleanCapability
(String capability) int
Returns the value of stty rows>/tt> param.getNumericCapability
(String capability) getStringCapability
(String capability) int
getWidth()
Returns the value of stty columns param.boolean
Defaults to true which was the behaviour before this method was added.void
init()
Remove line-buffered input by invoking "stty -icanon min 1" against the current terminal.private void
void
restore()
Restore the original terminal configuration, which can be used when shutting down the console reader.void
setEchoEnabled
(boolean enabled) Methods inherited from class jline.TerminalSupport
getOutputEncoding, isAnsiSupported, isEchoEnabled, isSupported, reset, setAnsiSupported, wrapInIfNeeded, wrapOutIfNeeded
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jline.Terminal
getOutputEncoding, isAnsiSupported, isEchoEnabled, isSupported, reset, wrapInIfNeeded, wrapOutIfNeeded
-
Field Details
-
settings
-
type
-
intr
-
lnext
-
bools
-
ints
-
strings
-
-
Constructor Details
-
Method Details
-
getSettings
-
init
Remove line-buffered input by invoking "stty -icanon min 1" against the current terminal.- Specified by:
init
in interfaceTerminal
- Overrides:
init
in classTerminalSupport
- Throws:
Exception
-
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:
restore
in interfaceTerminal
- Overrides:
restore
in classTerminalSupport
- Throws:
Exception
-
getWidth
public int getWidth()Returns the value of stty columns param.- Specified by:
getWidth
in interfaceTerminal
- Overrides:
getWidth
in classTerminalSupport
-
getHeight
public int getHeight()Returns the value of stty rows>/tt> param.- Specified by:
getHeight
in interfaceTerminal
- Overrides:
getHeight
in classTerminalSupport
-
hasWeirdWrap
public boolean hasWeirdWrap()Description copied from class:TerminalSupport
Defaults to true which was the behaviour before this method was added.- Specified by:
hasWeirdWrap
in interfaceTerminal
- Overrides:
hasWeirdWrap
in classTerminalSupport
-
setEchoEnabled
public void setEchoEnabled(boolean enabled) - Specified by:
setEchoEnabled
in interfaceTerminal
- Overrides:
setEchoEnabled
in classTerminalSupport
-
disableInterruptCharacter
public void disableInterruptCharacter()- Specified by:
disableInterruptCharacter
in interfaceTerminal
- Overrides:
disableInterruptCharacter
in classTerminalSupport
-
enableInterruptCharacter
public void enableInterruptCharacter()- Specified by:
enableInterruptCharacter
in interfaceTerminal
- Overrides:
enableInterruptCharacter
in classTerminalSupport
-
disableLitteralNextCharacter
public void disableLitteralNextCharacter() -
enableLitteralNextCharacter
public void enableLitteralNextCharacter() -
getBooleanCapability
- Specified by:
getBooleanCapability
in interfaceTerminal2
-
getNumericCapability
- Specified by:
getNumericCapability
in interfaceTerminal2
-
getStringCapability
- Specified by:
getStringCapability
in interfaceTerminal2
-
parseInfoCmp
private void parseInfoCmp()
-