org.apache.sshd.common.util
Class SttySupport

java.lang.Object
  extended by org.apache.sshd.common.util.SttySupport

public class SttySupport
extends java.lang.Object

Support for stty command on unix

Author:
Apache MINA SSHD Project

Constructor Summary
SttySupport()
           
 
Method Summary
static java.lang.String exec(java.lang.String cmd)
          Execute the specified command and return the output (both stdout and stderr).
static java.lang.String getSttyCommand()
          The command to use to set the terminal options.
static int getTerminalHeight()
          Returns the value of "stty size" height param.
static int getTerminalWidth()
          Returns the value of "stty size" width param.
static java.lang.String getTtyProps()
           
static java.util.Map<PtyMode,java.lang.Integer> getUnixPtyModes()
           
static java.util.Map<PtyMode,java.lang.Integer> parsePtyModes(java.lang.String stty)
           
static void setSttyCommand(java.lang.String cmd)
          The command to use to set the terminal options.
static java.lang.String stty(java.lang.String args)
          Execute the stty command with the specified arguments against the current active terminal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SttySupport

public SttySupport()
Method Detail

getUnixPtyModes

public static java.util.Map<PtyMode,java.lang.Integer> getUnixPtyModes()
                                                                throws java.io.IOException,
                                                                       java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

parsePtyModes

public static java.util.Map<PtyMode,java.lang.Integer> parsePtyModes(java.lang.String stty)

getTerminalWidth

public static 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.


getTerminalHeight

public static 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.


getTtyProps

public static java.lang.String getTtyProps()
                                    throws java.io.IOException,
                                           java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

stty

public static java.lang.String stty(java.lang.String args)
                             throws java.io.IOException,
                                    java.lang.InterruptedException
Execute the stty command with the specified arguments against the current active terminal.

Throws:
java.io.IOException
java.lang.InterruptedException

exec

public static java.lang.String exec(java.lang.String cmd)
                             throws java.io.IOException,
                                    java.lang.InterruptedException
Execute the specified command and return the output (both stdout and stderr).

Throws:
java.io.IOException
java.lang.InterruptedException

setSttyCommand

public static void setSttyCommand(java.lang.String cmd)
The command to use to set the terminal options. Defaults to "stty", or the value of the system property "jline.sttyCommand".


getSttyCommand

public static java.lang.String getSttyCommand()
The command to use to set the terminal options. Defaults to "stty", or the value of the system property "jline.sttyCommand".



Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.