public function render(IO $io, $indentation = 0)
{
$linePrefix = str_repeat(' ', $indentation);
$visibleLabel = $io->removeFormat($this->label);
$styleTagLength = strlen($this->label) - strlen($visibleLabel);
$textOffset = $this->aligned && $this->alignment ? $this->alignment->getTextOffset() - $indentation : 0;
$textOffset = max($textOffset, strlen($visibleLabel) + $this->padding);
$textPrefix = str_repeat(' ', $textOffset);
// 1 trailing space
$textWidth = $io->getTerminalDimensions()->getWidth() - 1 - $textOffset - $indentation;
// TODO replace wordwrap() by implementation that is aware of format codes
$text = str_replace("\n", "\n" . $linePrefix . $textPrefix, wordwrap($this->text, $textWidth));
// Add the total length of the style tags ("<b>", ...)
$labelWidth = $textOffset + $styleTagLength;
$io->write(rtrim(sprintf("%s%-{$labelWidth}s%s", $linePrefix, $this->label, rtrim($text))) . "\n");
}