Interface Pty

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
CygwinPty, ExecPty

public interface Pty extends Closeable
Represents a pseudo-terminal (PTY) providing master/slave input and output streams. A PTY allows a program to interact with a terminal device, providing both the master side (for the controlling process) and the slave side (for the terminal).
  • Method Details

    • getMasterInput

      InputStream getMasterInput() throws IOException
      Returns the master side input stream.
      Returns:
      the master input stream
      Throws:
      IOException - if an I/O error occurs
    • getMasterOutput

      OutputStream getMasterOutput() throws IOException
      Returns the master side output stream.
      Returns:
      the master output stream
      Throws:
      IOException - if an I/O error occurs
    • getSlaveInput

      InputStream getSlaveInput() throws IOException
      Returns the slave side input stream.
      Returns:
      the slave input stream
      Throws:
      IOException - if an I/O error occurs
    • getSlaveOutput

      OutputStream getSlaveOutput() throws IOException
      Returns the slave side output stream.
      Returns:
      the slave output stream
      Throws:
      IOException - if an I/O error occurs
    • getAttr

      Attributes getAttr() throws IOException
      Returns the current terminal attributes.
      Returns:
      the terminal attributes
      Throws:
      IOException - if an I/O error occurs
    • setAttr

      void setAttr(Attributes attr) throws IOException
      Sets the terminal attributes.
      Parameters:
      attr - the attributes to set
      Throws:
      IOException - if an I/O error occurs
    • getSize

      Size getSize() throws IOException
      Returns the current terminal size.
      Returns:
      the terminal size
      Throws:
      IOException - if an I/O error occurs