jline
Class UnixTerminal

java.lang.Object
  extended by jline.TerminalSupport
      extended by jline.UnixTerminal
All Implemented Interfaces:
Terminal
Direct Known Subclasses:
NoInterruptUnixTerminal

public class UnixTerminal
extends TerminalSupport

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
Author:
Marc Prud'hommeaux, Dale Kemp, Jason Dillon, Jean-Baptiste Onofré

Field Summary
 
Fields inherited from class jline.TerminalSupport
DEFAULT_HEIGHT, DEFAULT_WIDTH
 
Constructor Summary
UnixTerminal()
           
 
Method Summary
 void disableInterruptCharacter()
           
 void enableInterruptCharacter()
           
 int getHeight()
          Returns the value of stty rows>/tt> param.
protected  TerminalLineSettings getSettings()
           
 int getWidth()
          Returns the value of stty columns param.
 void init()
          Remove line-buffered input by invoking "stty -icanon min 1" against the current terminal.
 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
hasWeirdWrap, 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
 

Constructor Detail

UnixTerminal

public UnixTerminal()
             throws Exception
Throws:
Exception
Method Detail

getSettings

protected TerminalLineSettings getSettings()

init

public void init()
          throws Exception
Remove line-buffered input by invoking "stty -icanon min 1" against the current terminal.

Specified by:
init in interface Terminal
Overrides:
init in class TerminalSupport
Throws:
Exception

restore

public void restore()
             throws Exception
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 interface Terminal
Overrides:
restore in class TerminalSupport
Throws:
Exception

getWidth

public int getWidth()
Returns the value of stty columns param.

Specified by:
getWidth in interface Terminal
Overrides:
getWidth in class TerminalSupport

getHeight

public int getHeight()
Returns the value of stty rows>/tt> param.

Specified by:
getHeight in interface Terminal
Overrides:
getHeight in class TerminalSupport

setEchoEnabled

public void setEchoEnabled(boolean enabled)
Specified by:
setEchoEnabled in interface Terminal
Overrides:
setEchoEnabled in class TerminalSupport

disableInterruptCharacter

public void disableInterruptCharacter()

enableInterruptCharacter

public void enableInterruptCharacter()


Copyright © 2013. All Rights Reserved.