Visual Studio 2022 on Windows 11 reuses the same console window on successive runs, overwriting the previous output
I’ve just installed VS 2022 on a new Windows 11 computer, and as the title says, it has a new behavior that I’ve never seen in 25+ years. When running without debug (F8), the console window is reused over successive runs, with the previous output being erased and overwritten instead of creating a new window and outputting there. This is quite annoying because I need to see each run separately to compare how code changes affect the result.
How do I change this back to the old behavior, other than by a hack like adding system("pause");
at the end of the file to prevent main() from returning?
There’s an unanswered stack exchange question about this same problem here: stackoverflow.com/questions/54657838/how-can-new-console-windows-be-created-for-each-run-when-running-a-console-progr and here: stackoverflow.com/questions/77335564/visual-studio-2022-on-windows-11-reuses-the-same-console-window-on-successive-ru
I have VS 2022 community running on Windows 10 and it does not do this; i.e. each run spawns a separate console window.
Read more here: Source link