Class AbstractPosixTerminal

java.lang.Object
org.jline.terminal.impl.AbstractTerminal
org.jline.terminal.impl.AbstractPosixTerminal
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, TerminalExt, Terminal
Direct Known Subclasses:
PosixPtyTerminal, PosixSysTerminal

public abstract class AbstractPosixTerminal extends AbstractTerminal
  • Field Details

    • pty

      protected final Pty pty
    • originalAttributes

      protected final Attributes originalAttributes
  • Constructor Details

  • Method Details

    • getPty

      public Pty getPty()
    • getAttributes

      public Attributes getAttributes()
      Description copied from interface: Terminal
      Returns the terminal attributes. The returned object can be safely modified further used in a call to Terminal.setAttributes(Attributes).
      Returns:
      the terminal attributes.
    • setAttributes

      public void setAttributes(Attributes attr)
      Description copied from interface: Terminal
      Set the terminal attributes. The terminal will perform a copy of the given attributes.
      Parameters:
      attr - the new attributes
    • getSize

      public Size getSize()
      Description copied from interface: Terminal
      Retrieve the size of the visible window
      Returns:
      the visible terminal size
      See Also:
    • setSize

      public void setSize(Size size)
    • doClose

      protected void doClose() throws IOException
      Overrides:
      doClose in class AbstractTerminal
      Throws:
      IOException
    • getCursorPosition

      public Cursor getCursorPosition(IntConsumer discarded)
      Description copied from interface: Terminal
      Query the terminal to report the cursor position. As the response is read from the input stream, some characters may be read before the cursor position is actually read. Those characters can be given back using org.jline.keymap.BindingReader#runMacro(String)
      Specified by:
      getCursorPosition in interface Terminal
      Overrides:
      getCursorPosition in class AbstractTerminal
      Parameters:
      discarded - a consumer receiving discarded characters
      Returns:
      null if cursor position reporting is not supported or a valid cursor position
    • getProvider

      public TerminalProvider getProvider()
      Description copied from interface: TerminalExt
      Returns the TerminalProvider that created this terminal or null if the terminal was created with no provider.
    • getSystemStream

      public SystemStream getSystemStream()
      Description copied from interface: TerminalExt
      The underlying system stream, may be SystemStream.Output, SystemStream.Error, or null if this terminal is not bound to a system stream.