Reputation: 8288
I'm debugging a C# console application using Visual Studio for the Mac. I'm using frequent Console.WriteLine()
statements.
Is there anyway to clear the output of the Terminal - macOS
pad where the Console
output is displayed every time I run / debug the program? I've tried calls to Console.Clear()
to no effect. I have seen suggestions to use Cmd-K
but that doesn't work. Other suggestions are all for VSCode, not Visual Studio.
Surely I can't be the only one who finds seeing the old output distracting when debugging?
Upvotes: 11
Views: 2750
Reputation: 574
Use this as a workaround:
Console.Write("\f\u001bc\x1b[3J");
replace Console.Clear()
with the above
Upvotes: 0
Reputation: 1
I came here looking for the solution as I couldn't figure it out for the life of me, tried 'cmd + k' and it worked. I could have sworn I'd tried it in the past with no success. Maybe a few points that will help:
New to coding, first stack overflow comment, hope this has some value.
Upvotes: -1
Reputation: 127
Close the terminal window, then the next run will open an empty one.
Upvotes: -1
Reputation: 13
You may deactivate and reactivate the integrated terminal in : preferences\terminal options\uncheck\check. You may have to close VSFM between the uncheck\check process in order to clear the entre data. That way, it does clear the terminal data, but I would prefer some fast “clear” kind of short-cut options instead.
Have a good one.
Prog
Upvotes: 0
Reputation: 136
You aren't alone. I was just wondering why it didn't clear the screen either. There is an option to use Terminal, instead of the built in terminal. Check under Preferences > Terminal, then remove the check mark next to "Enable Integrated Terminal" and it will just pop up in a normal terminal which doesn't seem to have that issue. If you figure something else out let me know though.
Upvotes: 11