9

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

13
  • 1
    Sure you're talking about visual studio, not visual studio code? Commented Nov 6, 2022 at 7:37
  • 1
    @πάνταῥεῖ yes, Visual Studio, not Visual Studio Code. I want my console C app to be run inside a terminal inside visual studio app, not launching a separate terminal window
    – HII
    Commented Nov 6, 2022 at 7:40
  • 1
    Pretty sure visual studio doesn't even have an integrated terminal Commented Nov 6, 2022 at 7:48
  • 1
    @AlanBirtles It's been added awhile ago: A more integrated terminal experience
    – Ranoiaetep
    Commented Nov 6, 2022 at 7:50
  • 2
    @MinxinYu-MSFT I opened one here
    – HII
    Commented Nov 7, 2022 at 9:23

1 Answer 1

4

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">
4
  • it seems to direct the output to the output tab, good, , one more question, does it prevent the launch of the separate window? The real solution to my problem would be a way to direct the output and input as well to a terminal within the same window as visual studio's window, just like what happens in VSCode for example
    – HII
    Commented Nov 6, 2022 at 8:23
  • @Haidar It does not prevent the launch of the separate window, it still pops in the background. And it does not seem to handle input at all. Commented Nov 6, 2022 at 8:26
  • Apologies - removed comment.
    – Clifford
    Commented Nov 6, 2022 at 9:19
  • For VS 2022 Version 17.7.6 it pops up external console with Console redirected to Output Window in Visual Studio... but unfortunately, nothing comes to Output Tab Commented Mar 12 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.