HII
HII

Reputation: 4129

How to run C/C++ code using integrated terminal in Visual Studio

How to launch a C/C++ console application using the integrated terminal in Visual Studio instead of launching a separate terminal window?

To clarify more:

When I press the run button right now, this is what happens:

enter image description here

But what I want is something like this (but it must happen when I press the run button), where the output is directed to a terminal inside the visual studio window, without launching a separate window, this will make it easier when debugging because I won't have to switch between multiple windows: enter image description here

Upvotes: 9

Views: 2127

Answers (1)

user7860670
user7860670

Reputation: 37600

There is a handy VsConsoleOutput extension for Visual Studio 2019 / 2022 that redirects program output into Output window inside of Visual Studio. enter image description here However when installing it i've got an exception complaining about incorrect value of InstalledByMsi value somewhere in manifest. The workaround is to manually open downloaded .vsix package (which seems to be a .zip archive) using WinRAR or something, adjust one line in extension.vsixmanifest file and save updated archive.

<Installation AllUsers="true" InstalledByMsi="false">

Upvotes: 5

Related Questions