org.apache.sshd.common.util
Class SttySupport

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

public class SttySupport
extends Object

Support for stty command on unix

Author:
Apache MINA SSHD Project

Constructor Summary
SttySupport()
           
 
Method Summary
static String exec(String cmd)
          Execute the specified command and return the output (both stdout and stderr).
static 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 String getTtyProps()
           
static Map<PtyMode,Integer> getUnixPtyModes()
           
static Map<PtyMode,Integer> parsePtyModes(String stty)
           
static void setSttyCommand(String cmd)
          The command to use to set the terminal options.
static String stty(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 Map<PtyMode,Integer> getUnixPtyModes()
                                            throws IOException,
                                                   InterruptedException
Throws:
IOException
InterruptedException

parsePtyModes

public static Map<PtyMode,Integer> parsePtyModes(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 String getTtyProps()
                          throws IOException,
                                 InterruptedException
Throws:
IOException
InterruptedException

stty

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

Throws:
IOException
InterruptedException

exec

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

Throws:
IOException
InterruptedException

setSttyCommand

public static void setSttyCommand(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 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 Apache Software Foundation. All Rights Reserved.