简体   繁体   中英

How to stop Visual Studio Code from opening an external terminal window when I run my C code

I recently installed Visual Studio Code and when I run my C code, it will always open an external.exe window, when I would rather it just used the integrated terminal.

The extensions I have installed are:

C/C++ by Microsoft, C/C++ Extension Pack by Microsoft, C/C++ Themes by Microsoft, CMake by twxs, CMake Tools by twxs, Code Runner by Jun Han.

I also found an option within the settings of the Code Runner extension: "Code-runner: Run In Terminal". After ticking this option I can use the integrated terminal but Visual Studio first opens the external terminal which I have to close manually before I can actually use the integrated terminal.

Thanks in advance for any help.

You can add a launch.json file to the .vscode to the folder where your project resides and configure it to do so. The relevant configuration for controlling the usage of an external console is provided below (for further information, refer to the documentation ).

{
    "configurations": [
        {
            [...]
            "externalConsole": false,
            [...]
        }
    ]
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM