Before you mark this question as a duplicate, I have a very specific problem with the Console.Clear()
method. When I clear the console with this method, it just "pushes" all the output up until there's nothing left to see (i.e. prints a bunch of newlines). This works well with most of my applications but it doesn't work with ANSI escape codes that change the position of the cursor. E.g.:
Console.WriteLine("Hello");
Console.WriteLine("How are you");
Console.Clear();
Console.Write("x1b[0;0HI'm fine");
This would just print I'm fine
on the first line, that you can't actually see anymore (because it's been "pushed" up) instead of the "new" home position. I am using Cygwin terminal.
Please let me know how to "properly" clear the console window or set the cursor position.
Thanks.
question from:
https://stackoverflow.com/questions/65646604/c-can-you-completely-wipe-the-console-window 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…