Package jline
Class DefaultTerminal2
java.lang.Object
jline.DefaultTerminal2
Terminal wrapper with default ansi capabilities
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
boolean
getBooleanCapability
(String capability) int
getNumericCapability
(String capability) getStringCapability
(String capability) int
getWidth()
boolean
For terminals that don't wrap when character is written in last column, only when the next character is written.void
init()
boolean
boolean
boolean
private void
registerCap
(String cap) private void
registerCap
(String cap, String value) void
reset()
void
restore()
void
setEchoEnabled
(boolean enabled) When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.When ANSI is not natively handled, the output will have to be wrapped.
-
Field Details
-
terminal
-
bools
-
strings
-
-
Constructor Details
-
DefaultTerminal2
-
-
Method Details
-
init
-
restore
-
reset
-
isSupported
public boolean isSupported()- Specified by:
isSupported
in interfaceTerminal
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
isAnsiSupported
public boolean isAnsiSupported()- Specified by:
isAnsiSupported
in interfaceTerminal
-
wrapOutIfNeeded
Description copied from interface:Terminal
When ANSI is not natively handled, the output will have to be wrapped.- Specified by:
wrapOutIfNeeded
in interfaceTerminal
-
wrapInIfNeeded
Description copied from interface:Terminal
When using native support, return the InputStream to use for reading characters else return the input stream passed as a parameter.- Specified by:
wrapInIfNeeded
in interfaceTerminal
- Throws:
IOException
-
hasWeirdWrap
public boolean hasWeirdWrap()Description copied from interface:Terminal
For terminals that don't wrap when character is written in last column, only when the next character is written. These are the ones that have 'am' and 'xn' termcap attributes (xterm and rxvt flavors falls under that category)- Specified by:
hasWeirdWrap
in interfaceTerminal
-
isEchoEnabled
public boolean isEchoEnabled()- Specified by:
isEchoEnabled
in interfaceTerminal
-
setEchoEnabled
public void setEchoEnabled(boolean enabled) - Specified by:
setEchoEnabled
in interfaceTerminal
-
disableInterruptCharacter
public void disableInterruptCharacter()- Specified by:
disableInterruptCharacter
in interfaceTerminal
-
enableInterruptCharacter
public void enableInterruptCharacter()- Specified by:
enableInterruptCharacter
in interfaceTerminal
-
getOutputEncoding
- Specified by:
getOutputEncoding
in interfaceTerminal
-
registerCap
-
registerCap
-
getBooleanCapability
- Specified by:
getBooleanCapability
in interfaceTerminal2
-
getNumericCapability
- Specified by:
getNumericCapability
in interfaceTerminal2
-
getStringCapability
- Specified by:
getStringCapability
in interfaceTerminal2
-