Class JansiNativePty

java.lang.Object
org.jline.terminal.impl.AbstractPty
org.jline.terminal.impl.jansi.JansiNativePty
All Implemented Interfaces:
Closeable, AutoCloseable, Pty
Direct Known Subclasses:
FreeBsdNativePty, LinuxNativePty, OsXNativePty, SolarisNativePty

public abstract class JansiNativePty extends AbstractPty implements Pty
  • Constructor Details

  • Method Details

    • ttyname

      protected static String ttyname() throws IOException
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getMaster

      public int getMaster()
    • getSlave

      public int getSlave()
    • getSlaveOut

      public int getSlaveOut()
    • getName

      public String getName()
    • getMasterFD

      public FileDescriptor getMasterFD()
    • getSlaveFD

      public FileDescriptor getSlaveFD()
    • getSlaveOutFD

      public FileDescriptor getSlaveOutFD()
    • getMasterInput

      public InputStream getMasterInput()
      Description copied from interface: Pty
      Returns the input stream for the master side of the PTY.

      This stream receives data that has been written to the slave's output stream. Terminal emulators typically read from this stream to get the output from processes running in the terminal.

      Specified by:
      getMasterInput in interface Pty
      Returns:
      the master's input stream
    • getMasterOutput

      public OutputStream getMasterOutput()
      Description copied from interface: Pty
      Returns the output stream for the master side of the PTY.

      Data written to this stream will be available for reading from the slave's input stream. Terminal emulators typically write to this stream to send input to processes running in the terminal.

      Specified by:
      getMasterOutput in interface Pty
      Returns:
      the master's output stream
    • doGetSlaveInput

      protected InputStream doGetSlaveInput()
      Specified by:
      doGetSlaveInput in class AbstractPty
    • getSlaveOutput

      public OutputStream getSlaveOutput()
      Description copied from interface: Pty
      Returns the output stream for the slave side of the PTY.

      Data written to this stream will be available for reading from the master's input stream. Processes running in the terminal write to this stream to produce their output.

      Specified by:
      getSlaveOutput in interface Pty
      Returns:
      the slave's output stream
    • getAttr

      public Attributes getAttr() throws IOException
      Description copied from interface: Pty
      Returns the current terminal attributes for this PTY.

      Terminal attributes control various aspects of terminal behavior, such as echo settings, line discipline, and control characters.

      Specified by:
      getAttr in interface Pty
      Returns:
      the current terminal attributes
      Throws:
      IOException - if an I/O error occurs
      See Also:
    • doSetAttr

      protected void doSetAttr(Attributes attr) throws IOException
      Specified by:
      doSetAttr in class AbstractPty
      Throws:
      IOException
    • getSize

      public Size getSize() throws IOException
      Description copied from interface: Pty
      Returns the current size (dimensions) of this PTY.

      The size includes the number of rows and columns in the terminal window.

      Specified by:
      getSize in interface Pty
      Returns:
      the current terminal size
      Throws:
      IOException - if an I/O error occurs
      See Also:
    • setSize

      public void setSize(Size size) throws IOException
      Description copied from interface: Pty
      Sets the size (dimensions) of this PTY.

      This method changes the number of rows and columns in the terminal window. When the size changes, a SIGWINCH signal is typically sent to processes running in the terminal.

      Specified by:
      setSize in interface Pty
      Parameters:
      size - the new terminal size to set
      Throws:
      IOException - if an I/O error occurs
      See Also:
    • toTermios

      protected abstract org.fusesource.jansi.internal.CLibrary.Termios toTermios(Attributes t)
    • toAttributes

      protected abstract Attributes toAttributes(org.fusesource.jansi.internal.CLibrary.Termios tios)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isPosixSystemStream

      public static boolean isPosixSystemStream(SystemStream stream)
    • posixSystemStreamName

      public static String posixSystemStreamName(SystemStream systemStream)
    • systemStreamWidth

      public static int systemStreamWidth(SystemStream systemStream)