Package jexer.terminal
Class TerminalState
- java.lang.Object
-
- jexer.terminal.TerminalState
-
public class TerminalState extends java.lang.ObjectThis represents the full displayable state of the ECMA38 terminal.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCursorX()Expose current cursor X to outside world.intgetCursorY()Expose current cursor Y to outside world.java.util.List<DisplayLine>getDisplayBuffer()Get the portion of the display is within view.intgetHeight()Get the display height.ECMA48.MouseProtocolgetMouseProtocol()Get the mouse protocol.java.lang.StringgetScreenTitle()Get the screen title as set by the xterm OSC sequence.java.util.List<DisplayLine>getScrollbackBuffer()Get the portion of the display that has scrolled out of view.java.util.List<DisplayLine>getVisibleDisplay(int visibleHeight, int scrollBottom)Get the visible display + scrollback buffer, offset by a specified number of rows from the bottom.intgetWidth()Get the display width.booleanhasHiddenMousePointer()Returns true if this terminal has requested the mouse pointer be hidden.booleanisCursorVisible()Get visible cursor flag.booleanisPixelMouse()Check if terminal is reporting pixel-based mouse position.
-
-
-
Method Detail
-
getWidth
public final int getWidth()
Get the display width.- Returns:
- the width (usually 80 or 132)
-
getHeight
public final int getHeight()
Get the display height.- Returns:
- the height (usually 24)
-
isCursorVisible
public final boolean isCursorVisible()
Get visible cursor flag.- Returns:
- if true, the cursor is visible
-
getScrollbackBuffer
public final java.util.List<DisplayLine> getScrollbackBuffer()
Get the portion of the display that has scrolled out of view.- Returns:
- the scrollback buffer
-
getDisplayBuffer
public final java.util.List<DisplayLine> getDisplayBuffer()
Get the portion of the display is within view.- Returns:
- the display buffer
-
getVisibleDisplay
public final java.util.List<DisplayLine> getVisibleDisplay(int visibleHeight, int scrollBottom)
Get the visible display + scrollback buffer, offset by a specified number of rows from the bottom.- Parameters:
visibleHeight- the total height of the display to showscrollBottom- the number of rows from the bottom to scroll back- Returns:
- a copy of the display + scrollback buffers
-
getCursorX
public int getCursorX()
Expose current cursor X to outside world.- Returns:
- current cursor X
-
getCursorY
public int getCursorY()
Expose current cursor Y to outside world.- Returns:
- current cursor Y
-
hasHiddenMousePointer
public boolean hasHiddenMousePointer()
Returns true if this terminal has requested the mouse pointer be hidden.- Returns:
- true if this terminal has requested the mouse pointer be hidden
-
isPixelMouse
public boolean isPixelMouse()
Check if terminal is reporting pixel-based mouse position.- Returns:
- true if single-pixel mouse movements are reported
-
getMouseProtocol
public ECMA48.MouseProtocol getMouseProtocol()
Get the mouse protocol.- Returns:
- MouseProtocol.OFF, MouseProtocol.X10, etc.
-
getScreenTitle
public java.lang.String getScreenTitle()
Get the screen title as set by the xterm OSC sequence. Lots of applications send a screenTitle regardless of whether it is an xterm client or not.- Returns:
- screen title
-
-