Class PosixPtyTerminal

    • Constructor Detail

      • PosixPtyTerminal

        public PosixPtyTerminal​(java.lang.String name,
                                java.lang.String type,
                                Pty pty,
                                java.io.InputStream in,
                                java.io.OutputStream out,
                                java.nio.charset.Charset encoding)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • PosixPtyTerminal

        public PosixPtyTerminal​(java.lang.String name,
                                java.lang.String type,
                                Pty pty,
                                java.io.InputStream in,
                                java.io.OutputStream out,
                                java.nio.charset.Charset encoding,
                                Terminal.SignalHandler signalHandler)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • PosixPtyTerminal

        public PosixPtyTerminal​(java.lang.String name,
                                java.lang.String type,
                                Pty pty,
                                java.io.InputStream in,
                                java.io.OutputStream out,
                                java.nio.charset.Charset encoding,
                                Terminal.SignalHandler signalHandler,
                                boolean paused)
                         throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • input

        public java.io.InputStream input()
        Description copied from interface: Terminal
        Retrieve the input stream for this terminal. In some rare cases, there may be a need to access the terminal input stream directly. In the usual cases, use the Terminal.reader() instead.
        Returns:
        The input stream
        See Also:
        Terminal.reader()
      • reader

        public NonBlockingReader reader()
        Description copied from interface: Terminal
        Retrieve the Reader for this terminal. This is the standard way to read input from this terminal. The reader is non blocking.
        Returns:
        The non blocking reader
      • output

        public java.io.OutputStream output()
        Description copied from interface: Terminal
        Retrieve the output stream for this terminal. In some rare cases, there may be a need to access the terminal output stream directly. In the usual cases, use the Terminal.writer() instead.
        Returns:
        The output stream
        See Also:
        Terminal.writer()
      • writer

        public java.io.PrintWriter writer()
        Description copied from interface: Terminal
        Retrieve the Writer for this terminal. This is the standard way to write to this terminal.
        Returns:
        The writer
      • doClose

        protected void doClose()
                        throws java.io.IOException
        Overrides:
        doClose in class AbstractPosixTerminal
        Throws:
        java.io.IOException
      • pause

        public void pause​(boolean wait)
                   throws java.lang.InterruptedException
        Description copied from interface: Terminal
        Stop reading the input stream and optionally wait for the underlying threads to finish.
        Specified by:
        pause in interface Terminal
        Overrides:
        pause in class AbstractTerminal
        Parameters:
        wait - true to wait until the terminal is actually paused
        Throws:
        java.lang.InterruptedException - if the call has been interrupted
      • paused

        public boolean paused()
        Description copied from interface: Terminal
        Check whether the terminal is currently reading the input stream or not. In order to process signal as quickly as possible, the terminal need to read the input stream and buffer it internally so that it can detect specific characters in the input stream (Ctrl+C, Ctrl+D, etc...) and raise the appropriate signals. However, there are some cases where this processing should be disabled, for example when handing the terminal control to a subprocess.
        Specified by:
        paused in interface Terminal
        Overrides:
        paused in class AbstractTerminal
        Returns:
        whether the terminal is currently reading the input stream or not
        See Also:
        Terminal.pause(), Terminal.resume()