If you look at programs like Nano, Vim, or sl, it clears your screen while the program is running and opens a "new screen." Once the program is finished running, the original terminal with your command history reappears.
Is there a way to get this effect in C++ on Linux/MacOS without the ncurses library? I'd like my program to clear the screen during runtime and return to the state it was at before running. How could this be done on Windows?