Class AbstractExecPty

java.lang.Object
org.aesh.terminal.tty.impl.AbstractExecPty
All Implemented Interfaces:
Closeable, AutoCloseable, Pty
Direct Known Subclasses:
CygwinPty, ExecPty

public abstract class AbstractExecPty extends Object implements Pty
Abstract base class for PTY implementations that use external commands (stty, tty) to interact with the terminal.
  • Constructor Details

    • AbstractExecPty

      protected AbstractExecPty(String name)
      Constructor.
      Parameters:
      name - the pty name
  • Method Details

    • getName

      public String getName()
      Returns the name of the TTY device.
      Returns:
      the TTY device name
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getMasterInput

      public InputStream getMasterInput()
      Description copied from interface: Pty
      Returns the master side input stream.
      Specified by:
      getMasterInput in interface Pty
      Returns:
      the master input stream
    • getMasterOutput

      public OutputStream getMasterOutput()
      Description copied from interface: Pty
      Returns the master side output stream.
      Specified by:
      getMasterOutput in interface Pty
      Returns:
      the master output stream
    • exec

      protected static String exec(String... cmd) throws IOException
      Execute a command.
      Parameters:
      cmd - the command to execute
      Returns:
      the command output
      Throws:
      IOException - if execution fails