Run C/C++ code in terminal instead of debug console in VSCode on MacOS?

Viewed 181

I am trying to set up VSCode as a C/C++ development environment using gcc/g++ installed from homebrew on my MacBook.

It all works fine. When I run a file, it finds gcc which I installed with homebrew. However, the output is shown in the debug console instead of in the terminal which I would prefer: enter image description here

I tried to look online, but I couldn't find any way to do it. In addition, on my Windows desktop, I followed the same procedure to set up VSCode and it did run in the integrated terminal.

Why does it run in the terminal on Windows by default and not on Mac and how can I configure it to run in a terminal?

3 Answers

Maybe you set the debug console as the default option. You can type "ctrl+shift+P" and then choose launch.json. Delete the line "console": "internalConsole"

File -> Preferences -> Settings -> Extensions -> Run Code Config -> Run In Terminal

This should work ^^

You could run it from the terminal. You can open a terminal via ^⇧` This works great for me.

Related