Class Curses

java.lang.Object
org.jline.utils.Curses

public final class Curses extends Object
Utility class for terminal cursor and screen manipulation using ANSI escape sequences.

The Curses class provides methods for manipulating the terminal display using ANSI escape sequences and terminal capabilities. It includes functionality for cursor movement, screen clearing, text attributes, and other terminal operations.

This class is named after the curses library commonly used in Unix-like systems for terminal control, though it provides a simplified subset of functionality. It handles the complexities of formatting and interpreting terminal capability strings, allowing for portable terminal manipulation across different terminal types.

Key features include:

  • Cursor positioning and movement
  • Screen and line clearing
  • Text attribute control (bold, underline, etc.)
  • Color manipulation
  • Terminal capability string parsing and execution

This class is used internally by JLine components to perform terminal operations in a consistent way across different terminal types and platforms.

  • Method Details

    • tputs

      public static String tputs(String cap, Object... params)
      Print the given terminal capabilities
      Parameters:
      cap - the capability to output
      params - optional parameters
      Returns:
      the result string
    • tputs

      public static void tputs(Appendable out, String str, Object... params)
      Print the given terminal capabilities
      Parameters:
      out - the output stream
      str - the capability to output
      params - optional parameters