Documentation

Terminal
in package

Table of Contents

Constants

DEFAULT_COLOR_MODE  = \Symfony\Component\Console\Output\AnsiColorMode::Ansi4

Properties

$colorMode  : AnsiColorMode|null
$height  : int|null
$stty  : bool|null
$width  : int|null

Methods

getColorMode()  : AnsiColorMode
About Ansi color types: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors For more information about true color support with terminals https://github.com/termstandard/colors/.
getHeight()  : int
Gets the terminal height.
getWidth()  : int
Gets the terminal width.
setColorMode()  : void
Force a terminal color mode rendering.
getConsoleMode()  : array<string|int, int>|null
Runs and parses mode CON if it's available, suppressing any error output.
getSttyColumns()  : string|null
Runs and parses stty -a if it's available, suppressing any error output.
hasVt100Support()  : bool
Returns whether STDOUT has vt100 support (some Windows 10+ configurations).
initDimensions()  : void
initDimensionsUsingStty()  : void
Initializes dimensions using the output of an stty columns line.
readFromProcess()  : string|null

Constants

DEFAULT_COLOR_MODE

public mixed DEFAULT_COLOR_MODE = \Symfony\Component\Console\Output\AnsiColorMode::Ansi4

Properties

$height

private static int|null $height = null

$stty

private static bool|null $stty = null

$width

private static int|null $width = null

Methods

getColorMode()

About Ansi color types: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors For more information about true color support with terminals https://github.com/termstandard/colors/.

public static getColorMode() : AnsiColorMode
Return values
AnsiColorMode

getHeight()

Gets the terminal height.

public getHeight() : int
Return values
int

getWidth()

Gets the terminal width.

public getWidth() : int
Return values
int

getConsoleMode()

Runs and parses mode CON if it's available, suppressing any error output.

private static getConsoleMode() : array<string|int, int>|null
Return values
array<string|int, int>|null

An array composed of the width and the height or null if it could not be parsed

getSttyColumns()

Runs and parses stty -a if it's available, suppressing any error output.

private static getSttyColumns() : string|null
Return values
string|null

hasVt100Support()

Returns whether STDOUT has vt100 support (some Windows 10+ configurations).

private static hasVt100Support() : bool
Return values
bool

initDimensions()

private static initDimensions() : void

initDimensionsUsingStty()

Initializes dimensions using the output of an stty columns line.

private static initDimensionsUsingStty() : void

readFromProcess()

private static readFromProcess(string|array<string|int, mixed> $command) : string|null
Parameters
$command : string|array<string|int, mixed>
Return values
string|null

        
On this page

Search results