Search code examples
consolevisual-studio-codevscode-debugger

How do I permanently hide the debug console in VS Code?


I would like to configure my Debug-Console, so that it stops opening automatically each, and every time, I run my code. FYI, I am writing C#, and using the OmniSharp C# extension.


Solution


  • Configure the Debug Console to Stop Auto-Opening

    "To configure the Debug Console so that it doesn't open automatically when you run your code, you will need to correctly configure the following setting: debug.internalConsoleOptions by assigning the the string value "neverOpen" to it. The code snippet below demonstrates the correct configuration for disabling the Debug Console's Auto Open On Run feature."

    
        // ".../.vscode/settings.json"
    
        {
            "debug.internalConsoleOptions": "neverOpen"
        }
    
    

    Add the Setting to one of your settings.json files

    "The configuration shown above can be configured in the user, or workspace settings.json file. Another option users have is to configure it via the V.S. Code GUI settings menu. The Settings Keyboard Shortcut, for opening the menu is shown below."

    Settings Menu Keybinding: CTRL ,




    EDIT:

    (Edited the paragraph below)

    Best Practices for Testing New Configurations:

    "Its considered a good practice to always try a configuration for the first time in the workspace settings.json because the user settings.json file can be overridden by extensions. which can cause confusing results when testing new configurations. This is a Debug setting, so you need to go another step further, because launch.json is top level for debug settings, therefore you need to also add the setting to your launch.json file."

    See this link to see what I am talking about



    I don't write C#, but it should look something like this:

    (and I bet you will find it there already, overriding your settings.json file)

    {
      "name": "Run_Nodejs_Debugger",
      "type": "node",
      "request": "launch",
      "program": "./build/index.js",
      "internalConsoleOptions": "neverOpen" // ADD IT HERE!!!!
      "args": [""]
    }