VS Code starts debugging in integrated terminal instead of debug console

前端 未结 6 1184
一向
一向 2020-12-02 17:14

I\'ve been using VS Code for quite some time and just today I started having this strange issue. Previously if I started debugging an program (F5) it would start debugging a

6条回答
  •  生来不讨喜
    2020-12-02 17:38

    Edit 3

    As with the release 2019.4.0 of the python extension it is now possible to set the console option to internalConsole (#4321).

    In .vscode/launch.json:

    "console": "internalConsole"
    

    Edit 2

    As suggested in omartin2010's answer you can additionally set the option

    "internalConsoleOptions": "openOnSessionStart"
    

    to automatically open the debug console when starting debugging.

    Edit 1

    Setting the "console" option explicitly to "none" was originally the way to go (see answers), but now "none" is no longer valid (see Edit 3 above)

    "console": "none"
    

    Original answer

    To ensure that the output is written to the debug console you can set the debugOptions. Adding the following entry to your configuration in yourlaunch.json should fix it:

    "debugOptions": [
        "RedirectOutput"
    ]
    

提交回复
热议问题