Class ScreenTerminal


  • public class ScreenTerminal
    extends java.lang.Object
    A virtual terminal screen implementation.

    This class provides a virtual terminal screen that can process ANSI escape sequences and maintain the state of a terminal display. It supports features including:

    • Cursor positioning and movement
    • Text attributes (bold, underline, etc.)
    • Color support (including 256 colors)
    • Screen clearing and scrolling
    • Alternate screen buffer
    • Screen resizing

    This implementation is based on the Apache Karaf WebConsole Gogo plugin, with adaptations to support alternate screen, resizing, and 256 colors. It follows the ECMA-48 standard for terminal control sequences.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dump​(long[] fullscreen, int ftop, int fleft, int fheight, int fwidth, int[] cursor)  
      java.lang.String dump​(long timeout, boolean forceDump)  
      boolean isDirty()  
      java.lang.String pipe​(java.lang.String d)  
      java.lang.String read()  
      protected void setDirty()  
      boolean setSize​(int w, int h)  
      java.lang.String toString()  
      void waitDirty()  
      boolean write​(java.lang.CharSequence d)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ScreenTerminal

        public ScreenTerminal()
      • ScreenTerminal

        public ScreenTerminal​(int width,
                              int height)
    • Method Detail

      • isDirty

        public boolean isDirty()
      • waitDirty

        public void waitDirty()
                       throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • setDirty

        protected void setDirty()
      • setSize

        public boolean setSize​(int w,
                               int h)
      • read

        public java.lang.String read()
      • pipe

        public java.lang.String pipe​(java.lang.String d)
      • write

        public boolean write​(java.lang.CharSequence d)
      • dump

        public void dump​(long[] fullscreen,
                         int ftop,
                         int fleft,
                         int fheight,
                         int fwidth,
                         int[] cursor)
      • dump

        public java.lang.String dump​(long timeout,
                                     boolean forceDump)
                              throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • toString

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