getRenderedString method
Returns a list of strings representing the ANSI-encoded rendered output, one string per row.
Implementation
List<String> getRenderedString() {
List<String> renderedString = [];
for (var row in _screenBuffer) {
final buffer = StringBuffer();
BufferCell? lastCell;
for (final cell in row) {
if (lastCell == null || !_sameStyle(cell, lastCell)) {
buffer.write('\x1B[0');
buffer.write(_ansiCode(cell));
lastCell = cell;
}
buffer.write(cell.char);
}
buffer.write('\x1B[0m');
renderedString.add(buffer.toString());
}
return renderedString;
}