dispose method
Disposes of terminal resources and restores original state.
This should restore:
- Cursor visibility
- Raw mode
- Alt screen
- Mouse tracking
- Bracketed paste
Implementation
@override
void dispose() {
if (_bracketedPasteEnabled) disableBracketedPaste();
if (_mouseEnabled) disableMouse();
if (!_cursorVisible) showCursor();
if (_altScreenEnabled) exitAltScreen();
if (isRawMode) disableRawMode();
_inputSubscription?.cancel();
_inputSubscription = null;
_inputController.close();
backend.dispose();
}