Alternate Screen Switching
By targetingalternate-screen screenMode, OpenTUI shifts rendering streams from standard output to the console’s secondary buffer matrix. When exiting or aborting, it cleanly restores the main TUI console buffer, preventing cursor stack traces.