jline
public class UnixTerminal extends Terminal
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.
Field Summary | |
---|---|
static short | ARROW_DOWN |
static short | ARROW_LEFT |
static short | ARROW_PREFIX |
static short | ARROW_RIGHT |
static short | ARROW_START |
static short | ARROW_UP |
static short | DEL_SECOND |
static short | DEL_THIRD |
static short | END_CODE |
static short | HOME_CODE |
static short | O_PREFIX |
Constructor Summary | |
---|---|
UnixTerminal() |
Method Summary | |
---|---|
protected void | checkBackspace() |
void | disableEcho() |
void | enableEcho() |
boolean | getEcho() |
static String | getSttyCommand()
The command to use to set the terminal options. |
int | getTerminalHeight()
Returns the value of "stty size" height param.
|
int | getTerminalWidth()
Returns the value of "stty size" width param.
|
void | initializeTerminal()
Remove line-buffered input by invoking "stty -icanon min 1"
against the current terminal. |
boolean | isEchoEnabled() |
boolean | isSupported() |
int | readVirtualKey(InputStream in) |
void | restoreTerminal()
Restore the original terminal configuration, which can be used when
shutting down the console reader. |
static void | setSttyCommand(String cmd)
The command to use to set the terminal options. |