I've seen terminal apps, such as vim, that when used fill the whole screen and then disappear entirely when they are quit, i.e. they do not simply print into the current terminal "space":
I was wondering how in C# I can accomplish this.
The program uses the alternate screen feature of the terminal (originally xterm, but others).
vim is using the terminal description, which includes escape sequences for starting and ending the use of cursor-addressing. Mostly (for xterm and imitators) that switches to/from the alternate screen, saving/restoring the cursor position in the normal screen. Not all terminal descriptions use the feature.
A history of the feature is given in the xterm FAQ Why doesn't the screen clear when running vi?. Originally this was (in terminfo format)
\E is the ASCII escape character
\033), and the modern version is
Referring to MSDN, this probably will work for
\u001b. Similarly, for
\E[2J\E[?47l\E8, you could write