Class AnsiTerminal

    • Constructor Detail

      • AnsiTerminal

        public AnsiTerminal​(java.io.OutputStream outputStream,
                            Terminals.Output output)
    • Method Detail

      • toString

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

        public boolean supportsTextAttributes()
        Description copied from interface: TerminalOutput
        Returns true if this terminal supports setting text attributes, such as bold.
      • supportsColor

        public boolean supportsColor()
        Description copied from interface: TerminalOutput
        Returns true if this terminal supports setting output colors.
      • supportsCursorMotion

        public boolean supportsCursorMotion()
        Description copied from interface: TerminalOutput
        Returns true if this terminal supports moving the cursor.
      • supportsCursorVisibility

        public boolean supportsCursorVisibility()
        Description copied from interface: TerminalOutput
        Returns true if this terminal supports hiding the cursor.
      • getTerminalSize

        public TerminalSize getTerminalSize()
                                     throws NativeException
        Description copied from interface: TerminalOutput
        Returns the size of the terminal. Supported by all terminals.
        Returns:
        The current terminal size. Never returns null.
        Throws:
        NativeException - On failure.
      • getOutputStream

        public java.io.OutputStream getOutputStream()
        Description copied from interface: TerminalOutput
        Returns an OutputStream that writes to this terminal. The output stream is not buffered.
      • defaultForeground

        public TerminalOutput defaultForeground()
                                         throws NativeException
        Description copied from interface: TerminalOutput
        Sets the terminal foreground color to the default, if supported. Does nothing if this terminal does not support setting the foreground color.
        Throws:
        NativeException - On failure.
      • cursorRight

        public TerminalOutput cursorRight​(int count)
                                   throws NativeException
        Description copied from interface: TerminalOutput
        Moves the cursor the given number of characters to the right.
        Throws:
        NativeException - On failure, or if this terminal does not support cursor motion.
      • clearToEndOfLine

        public TerminalOutput clearToEndOfLine()
                                        throws NativeException
        Description copied from interface: TerminalOutput
        Clears characters from the cursor position to the end of the current line.
        Throws:
        NativeException - On failure, or if this terminal does not support clearing.