Class TerminfoTerminal

java.lang.Object
net.rubygrapefruit.platform.internal.AbstractTerminal
net.rubygrapefruit.platform.internal.TerminfoTerminal
All Implemented Interfaces:
TerminalOutput

public class TerminfoTerminal extends AbstractTerminal
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • init

      protected void init()
      Specified by:
      init in class AbstractTerminal
    • getTerminalSize

      public TerminalSize getTerminalSize()
      Description copied from interface: TerminalOutput
      Returns the size of the terminal. Supported by all terminals.
      Returns:
      The current terminal size. Never returns null.
    • 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.
    • supportsTextAttributes

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

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

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

      public TerminalOutput foreground(TerminalOutput.Color color)
      Description copied from interface: TerminalOutput
      Sets the terminal foreground color, if supported. Does nothing if this terminal does not support setting the foreground color.
    • bold

      public TerminalOutput bold()
      Description copied from interface: TerminalOutput
      Switches the terminal to bold text mode, if supported. Does nothing if this terminal does not support bold mode.

      Often the same as TerminalOutput.bright().

    • dim

      public TerminalOutput dim() throws NativeException
      Description copied from interface: TerminalOutput
      Switches the terminal to dim intensity, if supported. Does nothing if this terminal does not support dim mode.
      Throws:
      NativeException - On failure.
    • bright

      public TerminalOutput bright() throws NativeException
      Description copied from interface: TerminalOutput
      Switches the terminal to high intensity, if supported. Does nothing if this terminal does not support bright mode.
      Throws:
      NativeException - On failure.
    • normal

      public TerminalOutput normal()
      Description copied from interface: TerminalOutput
      Switches the terminal to normal text mode. Switches off bold text mode and sets normal intensity. Supported by all terminals.
    • 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.
    • reset

      public TerminalOutput reset()
      Description copied from interface: TerminalOutput
      Resets this terminal. Switches to normal text mode, restores default foreground color and shows the cursor. Supported by all terminals.
    • hideCursor

      public TerminalOutput hideCursor() throws NativeException
      Description copied from interface: TerminalOutput
      Hides the cursor. Does nothing if this terminal does not support hiding the cursor.
      Throws:
      NativeException - On failure.
    • showCursor

      public TerminalOutput showCursor() throws NativeException
      Description copied from interface: TerminalOutput
      Shows the cursor, if hidden. Supported by all terminals.
      Throws:
      NativeException - On failure.
    • cursorDown

      public TerminalOutput cursorDown(int count)
      Description copied from interface: TerminalOutput
      Moves the cursor the given number of characters down.
    • cursorUp

      public TerminalOutput cursorUp(int count)
      Description copied from interface: TerminalOutput
      Moves the cursor the given number of characters up.
    • cursorLeft

      public TerminalOutput cursorLeft(int count)
      Description copied from interface: TerminalOutput
      Moves the cursor the given number of characters to the left.
    • cursorRight

      public TerminalOutput cursorRight(int count)
      Description copied from interface: TerminalOutput
      Moves the cursor the given number of characters to the right.
    • cursorStartOfLine

      public TerminalOutput cursorStartOfLine() throws NativeException
      Description copied from interface: TerminalOutput
      Moves the cursor to the start of the current line.
      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.