InteractsWithAnsi
trait InteractsWithAnsi
Methods
string
mbWordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false)
Multi-byte version of wordwrap.
array
ansiWordwrap(string $text, int $width, bool $cutLongWords = false)
Word wrap text while preserving ANSI escape sequences.
string
truncateAnsi(string $text, int $width)
Truncate visible ANSI text without cutting a control sequence.
array
parseAnsiText(string $text)
Parse text into segments with their associated ANSI codes.
void
updateSgrState(array $activeSgr, string $escape)
Update the bounded set of active SGR attributes.
Details
at line 16
protected string
mbWordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false)
Multi-byte version of wordwrap.
at line 109
protected array
ansiWordwrap(string $text, int $width, bool $cutLongWords = false)
Word wrap text while preserving ANSI escape sequences.
at line 134
protected string
truncateAnsi(string $text, int $width)
Truncate visible ANSI text without cutting a control sequence.
at line 246
protected array
parseAnsiText(string $text)
Parse text into segments with their associated ANSI codes.
at line 358
protected void
updateSgrState(array $activeSgr, string $escape)
Update the bounded set of active SGR attributes.