Package net.morimekta.console.util
Class STTY
- java.lang.Object
-
- net.morimekta.console.util.STTY
-
public class STTY extends java.lang.Object
A terminal controller helper.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCachedTerminalSize()
Clear the cached terminal size regardless of when it was last checked.TerminalSize
getTerminalSize()
Get the terminal size.boolean
isInteractive()
STTYModeSwitcher
setSTTYMode(STTYMode mode)
Set the current STTY mode, and return the closable switcher to turn back.java.lang.String
toString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setSTTYMode
public STTYModeSwitcher setSTTYMode(STTYMode mode)
Set the current STTY mode, and return the closable switcher to turn back.- Parameters:
mode
- The STTY mode to set.- Returns:
- The mode switcher.
-
getTerminalSize
public TerminalSize getTerminalSize()
Get the terminal size.- Returns:
- the terminal size.
- Throws:
java.io.UncheckedIOException
- If getting the terminal size failed.
-
clearCachedTerminalSize
public void clearCachedTerminalSize()
Clear the cached terminal size regardless of when it was last checked.
-
isInteractive
public boolean isInteractive()
- Returns:
- True if this is an interactive TTY terminal.
-
-