TerminalInfo

data class TerminalInfo(var width: Int, var height: Int, var ansiLevel: AnsiLevel, var ansiHyperLinks: Boolean, val outputInteractive: Boolean, val inputInteractive: Boolean, val crClearsLine: Boolean)

Information about the current terminal

width and height don't automatically change if the terminal is resized. Call updateTerminalSize to get the latest values.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, ansiLevel: AnsiLevel, ansiHyperLinks: Boolean, outputInteractive: Boolean, inputInteractive: Boolean, crClearsLine: Boolean)

Properties

Link copied to clipboard

If true, ANSI hyperlink codes can be used

Link copied to clipboard

The level of ANSI codes to use when printing to the terminal

Link copied to clipboard

If true, \r will clear the entire line it's printed on in the current terminal, if false, \r will only move the cursor

Link copied to clipboard
var height: Int

The terminal height, in cells

Link copied to clipboard

If false the intput stream is not an interactive terminal, such as when it's redirected from a file

Link copied to clipboard

Return true if both input and output are interactive

Link copied to clipboard

If false the output stream is not an interactive terminal, such as when it's redirected to a file.

Link copied to clipboard
var width: Int

The terminal width, in cells

Functions

Link copied to clipboard

Query the terminal for its current size, updating width and height if successful.