Terminal
class Terminal
Properties
| protected string|null | $initialTtyMode | The initial TTY mode. |
|
| static protected bool|null | $trueColorSupport | Whether the terminal supports true color. |
|
| static protected null|array{int, int, int} | $foregroundColor | The terminal's foreground color as an RGB array. |
|
| static protected null|array{int, int, int} | $backgroundColor | The terminal's background color as an RGB array. |
|
| protected Terminal | $terminal | The Symfony Terminal instance. |
Methods
Create a new Terminal instance.
Read a line from the terminal.
Set the TTY mode.
Restore the initial TTY mode.
Get the number of columns in the terminal.
Get the number of lines in the terminal.
(Re)initialize the terminal dimensions.
Exit the interactive session.
Execute the given command and return the output.
Determine if the terminal supports true color (24-bit).
Get the terminal's foreground color as an RGB array.
Get the terminal's background color as an RGB array.
Query the terminal for foreground and background colors in a single shot.
Flush all static state.
Details
at line 45
__construct()
Create a new Terminal instance.
at line 53
string
read()
Read a line from the terminal.
at line 63
void
setTty(string $mode)
Set the TTY mode.
at line 73
void
restoreTty()
Restore the initial TTY mode.
at line 85
int
cols()
Get the number of columns in the terminal.
at line 93
int
lines()
Get the number of lines in the terminal.
at line 101
void
initDimensions()
(Re)initialize the terminal dimensions.
at line 111
void
exit()
Exit the interactive session.
at line 119
protected string
exec(string $command)
Execute the given command and return the output.
at line 144
bool
supportsTrueColor()
Determine if the terminal supports true color (24-bit).
at line 154
array
foregroundColor()
Get the terminal's foreground color as an RGB array.
at line 168
array
backgroundColor()
Get the terminal's background color as an RGB array.
at line 180
protected void
queryColors()
Query the terminal for foreground and background colors in a single shot.
at line 220
static void
flushState()
Flush all static state.