TracksTaskOutput
trait TracksTaskOutput
Track bounded incremental output owned by a Task operation.
Traits
Constants
| private CONTROL_MODE_ESCAPE |
|
| private CONTROL_MODE_CSI_PARAMETERS |
|
| private CONTROL_MODE_CSI_INTERMEDIATES |
|
| private CONTROL_MODE_OSC |
|
| private CONTROL_MODE_STRING |
|
Properties
| protected int|null | $partialStartIndex | The log index where the current partial started, or null if not streaming. |
Methods
Multi-byte version of wordwrap.
Word wrap text while preserving ANSI escape sequences.
Truncate visible ANSI text without cutting a control sequence.
Parse text into segments with their associated ANSI codes.
Update the bounded set of active SGR attributes.
Get the length of the longest line.
Pad text ignoring ANSI escape sequences.
Replace the last visible grapheme while preserving trailing formatting.
Strip ANSI escape sequences from the given text.
Add a complete logical log message.
Replace the in-progress partial with a complete supplied prefix.
Details
in
InteractsWithAnsi at line 16
protected string
mbWordwrap(string $string, int $width = 75, string $break = "\n", bool $cut_long_words = false)
Multi-byte version of wordwrap.
in
InteractsWithAnsi at line 109
protected array
ansiWordwrap(string $text, int $width, bool $cutLongWords = false)
Word wrap text while preserving ANSI escape sequences.
in
InteractsWithAnsi at line 134
protected string
truncateAnsi(string $text, int $width)
Truncate visible ANSI text without cutting a control sequence.
in
InteractsWithAnsi at line 246
protected array
parseAnsiText(string $text)
Parse text into segments with their associated ANSI codes.
in
InteractsWithAnsi at line 358
protected void
updateSgrState(array $activeSgr, string $escape)
Update the bounded set of active SGR attributes.
in
InteractsWithStrings at line 19
protected int
longest(array $lines, int $padding = 0)
Get the length of the longest line.
in
InteractsWithStrings at line 30
protected string
pad(string $text, int $length, string $char = ' ')
Pad text ignoring ANSI escape sequences.
in
InteractsWithStrings at line 40
protected string
replaceLastVisibleGrapheme(string $line, string $replacement)
Replace the last visible grapheme while preserving trailing formatting.
in
InteractsWithStrings at line 71
protected string
stripEscapeSequences(string $text)
Strip ANSI escape sequences from the given text.
at line 94
protected void
addLogLines(string $line)
Add a complete logical log message.
at line 109
protected void
replacePartialLines(string $text)
Replace the in-progress partial with a complete supplied prefix.