Interface Terminal

All Superinterfaces:
AutoCloseable, Closeable

public interface Terminal extends Closeable
Terminal interface providing access to terminal functionality.
  • Method Details

    • getName

      String getName()
      Get the terminal name.
      Returns:
      the terminal name
    • handle

      Register a signal handler for the specified signal.
      Parameters:
      signal - the signal to handle
      handler - the handler to register
      Returns:
      the previous handler, or null if none
    • raise

      void raise(Signal signal)
      Raise a signal on this terminal.
      Parameters:
      signal - the signal to raise
    • input

      InputStream input()
      Get the terminal input stream.
      Returns:
      the input stream
    • output

      OutputStream output()
      Get the terminal output stream.
      Returns:
      the output stream
    • echo

      boolean echo()
      Get the current echo state of the terminal.
      Returns:
      true if echo is enabled
    • echo

      boolean echo(boolean echo)
      Set the echo state of the terminal.
      Parameters:
      echo - true to enable echo
      Returns:
      the previous echo state
    • getAttributes

      Attributes getAttributes()
      Get the terminal attributes.
      Returns:
      the terminal attributes
    • setAttributes

      void setAttributes(Attributes attr)
      Set the terminal attributes.
      Parameters:
      attr - the attributes to set
    • getSize

      Size getSize()
      Get the terminal size.
      Returns:
      the terminal size
    • device

      Device device()
      Get the terminal device for capability queries.
      Returns:
      the terminal device
    • getCodePointConsumer

      default Consumer<int[]> getCodePointConsumer()
      Get the code point consumer for this terminal.
      Returns:
      the code point consumer, or null if none