jline
Class Terminal.UnixTerminal
java.lang.Object
|
+--jline.Terminal
|
+--jline.Terminal.UnixTerminal
- Enclosing class:
- Terminal
- public static class Terminal.UnixTerminal
- extends Terminal
Terminal that is used for Unix platforms.
WARNING: this class executes the "stty"
commmand using Runtime.exec(java.lang.String)
in order to set and query
various terminal parameters. It will fail in a strict security,
and standard disclaimers about java programs that fork separate
commands apply. It also requires that "stty" is in the user's
PATH variable (which it almost always is).
- Author:
- Marc Prud'hommeaux
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Terminal.UnixTerminal
public Terminal.UnixTerminal()
initializeTerminal
public void initializeTerminal()
throws IOException,
InterruptedException
- Remove line-buffered input by invoking "stty -icanon min 1"
against the current terminal.
- Specified by:
initializeTerminal
in class Terminal
IOException
InterruptedException
getTerminalWidth
public int getTerminalWidth()
- Returns the value of "stty size" width param.
Note: this method caches the value from the
first time it is called in order to increase speed, which means
that changing to size of the terminal will not be reflected
in the console.
- Specified by:
getTerminalWidth
in class Terminal
getTerminalHeight
public int getTerminalHeight()
- Returns the value of "stty size" height param.
Note: this method caches the value from the
first time it is called in order to increase speed, which means
that changing to size of the terminal will not be reflected
in the console.
- Specified by:
getTerminalHeight
in class Terminal
Released under the terms of the GNU LGPL