Class Display

java.lang.Object
org.jline.utils.Display

public class Display extends Object
Manages terminal display and efficient screen updates with cursor positioning.

The Display class provides functionality for managing the display of content on the terminal screen. It handles the complexities of cursor positioning, line wrapping, and efficient screen updates to minimize the amount of data sent to the terminal.

This class supports two main modes of operation:

  • Full-screen mode - Takes over the entire terminal screen
  • Partial-screen mode - Updates only a portion of the screen, preserving content above

Key features include:

  • Efficient screen updates using cursor positioning
  • Support for multi-line content with proper wrapping
  • Handling of ANSI-styled text (colors, attributes)
  • Size-aware rendering that adapts to terminal dimensions
  • Cursor positioning relative to the display area

This class is used by various JLine components, such as LineReader, to provide efficient terminal display management for features like command-line editing, completion menus, and status messages.