As previously answered here: Console.Clear(); doesn't clean up the whole console
Console.Clear();
Console.WriteLine("\x1b[3J");
This sequence removes the whole content of the console. (But it only works reliable if the clear command is called first)
As described here: https://learn.microsoft.com/en-us/windows/console/clearing-the-screen
\x1b[3J
- "3J only clears the scroll back."\x1b[2J
- "2J only clears the visible window"