Interface ScreenRegion


public interface ScreenRegion
A region of the terminal screen that can be independently written to.

Screen regions are created by splitting the terminal via Connection.splitScreen(double). Each region has its own scrollback buffer and size. Content written to a region scrolls independently within that region's bounds.

Experimental API — this feature is under active development and the API may change.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the region's visible content and scrollback buffer.
    void
    Close this region, merging it back into the parent region.
    void
    Set a handler to be called when this region is resized.
    Returns the current size of this region.
    void
    write(String text)
    Write text to this region.
    default void
    Write a line of text to this region (appends newline).
  • Method Details

    • write

      void write(String text)
      Write text to this region.

      The text is appended to the region's scrollback buffer and rendered within the region's bounds. If the text exceeds the visible area, older content scrolls up within the region.

      Thread-safe — can be called from any thread.

      Parameters:
      text - the text to write, may contain ANSI escape sequences
    • writeln

      default void writeln(String text)
      Write a line of text to this region (appends newline).
      Parameters:
      text - the text to write
    • size

      Size size()
      Returns the current size of this region.
      Returns:
      the region size (width x height in characters)
    • setResizeHandler

      void setResizeHandler(Consumer<Size> handler)
      Set a handler to be called when this region is resized.
      Parameters:
      handler - the resize handler, or null to remove
    • clear

      void clear()
      Clear the region's visible content and scrollback buffer.
    • close

      void close()
      Close this region, merging it back into the parent region. After closing, this region can no longer be written to.