dispose method
void
dispose()
Frees libghostty-vt's terminal and every native object this terminal created (anchors included). Safe to call more than once. Not in xterm, whose terminal needs no cleanup; a forgotten terminal is freed by a finalizer some time after it is garbage collected.
Afterwards every member that reads or changes the terminal throws
StateError. A TerminalView never disposes its terminal.
Implementation
void dispose() {
if (_engine.isDisposed) return;
_engine.isDisposed = true;
_pending.clear();
_controller.dispose();
}