skip to Main Content

I use VS code on Mac OS for programming with C++. Pressing the run triangle button successfully compiles the code and it starts running in the Debug Console automatically. I can’t use the Debug Console, because it doesn’t accept keyboard entries in run-time for some reason. Is it possible to automatically run the code in the integrated Terminal instead, when pressing the run button?
Do I need to configure the launch.json?
Thanks

2

Answers


  1. Chosen as BEST ANSWER

    One workaround is to create inside the launch.json a configuration with the attribute.

    "externalConsole": true

    It doesn't solve the problem completely, but at least one can interact with the keyboard in runtime and also doesn't have to start the program via typing.


  2. Do I need to configure the launch.json?

    Yes. There’s an attribute console that can be set to integratedTerminal.

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Some Name",
                // ...
                "console": "integratedTerminal"
            }
        ]
    }
    

    Depending on the extension you are using, you may need to create `.vscode/launch.json’ manually. Sooner or later you may need a custom launch file anyway (e.g. when passing arguments).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search