Class JniNativePty

    • Constructor Detail

      • JniNativePty

        public JniNativePty​(TerminalProvider provider,
                            SystemStream systemStream,
                            int master,
                            java.io.FileDescriptor masterFD,
                            int slave,
                            java.io.FileDescriptor slaveFD,
                            java.lang.String name)
      • JniNativePty

        public JniNativePty​(TerminalProvider provider,
                            SystemStream systemStream,
                            int master,
                            java.io.FileDescriptor masterFD,
                            int slave,
                            java.io.FileDescriptor slaveFD,
                            int slaveOut,
                            java.io.FileDescriptor slaveOutFD,
                            java.lang.String name)
    • Method Detail

      • ttyname

        protected static java.lang.String ttyname​(int fd)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • close

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

        public int getMaster()
      • getSlave

        public int getSlave()
      • getSlaveOut

        public int getSlaveOut()
      • getName

        public java.lang.String getName()
      • getMasterFD

        public java.io.FileDescriptor getMasterFD()
      • getSlaveFD

        public java.io.FileDescriptor getSlaveFD()
      • getSlaveOutFD

        public java.io.FileDescriptor getSlaveOutFD()
      • getMasterInput

        public java.io.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 java.io.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
      • getSlaveOutput

        public java.io.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 java.io.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:
        java.io.IOException - if an I/O error occurs
        See Also:
        Attributes
      • doSetAttr

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

        public Size getSize()
                     throws java.io.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:
        java.io.IOException - if an I/O error occurs
        See Also:
        Size
      • setSize

        public void setSize​(Size size)
                     throws java.io.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:
        java.io.IOException - if an I/O error occurs
        See Also:
        Size
      • toString

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

        public static boolean isPosixSystemStream​(SystemStream stream)
      • posixSystemStreamName

        public static java.lang.String posixSystemStreamName​(SystemStream systemStream)
      • systemStreamWidth

        public static int systemStreamWidth​(SystemStream systemStream)