present method
Renders frame, diffed against the previous one, optionally placing the
hardware cursor.
Implementation
@override
void present(ScreenBuffer frame, {int? cursorX, int? cursorY}) {
final out =
StringBuffer('\x1b[?25l') // hide while painting
..write(frame.renderDiff(_front));
if (cursorX != null && cursorY != null) {
out.write('\x1b[${cursorY + 1};${cursorX + 1}H\x1b[?25h');
}
writeAnsi(out.toString());
_front = frame;
}