dispose method
Disposes of renderer resources.
Implementation
@override
void dispose() {
if (!_initialized) return;
final isInline = _options.isInline;
final isBounded = _options.isBounded;
if (!isBounded) {
terminal.write(uv_graphics.deleteAllRetainedGraphics());
_lastGraphicsFrame = uv_graphics.TerminalGraphicsFrame.empty;
} else {
terminal.write(Ansi.resetScrollRegion);
if (terminal.supportsAnsi) {
_clearInlineRegion();
}
if (isInline && _options.uiAnchor == UiAnchor.bottom) {
terminal.write(Ansi.cursorTo(terminal.height, 1));
}
}
if (_options.hideCursor) {
terminal.showCursor();
}
if (!isBounded && _options.altScreen) {
terminal.exitAltScreen();
}
_initialized = false;
}