visual-studio-codecmake

How to stop the CMake build panel from automatically opening in VS Code?


There are two actions which cause the CMake output panel to automatically open in VS Code.

  1. Restarting VS Code. CMake runs some configuration when VS Code starts, and this causes the panel to be automatically reopened
  2. Saving a modified CMakeLists.txt

Here is a screenshot of the output panel to clarify which object this is.

VS Code CMake panel

The automatic appearance of this panel on startup is slightly annoying but tolerable. However, the automatic loading when a CMakeLists.txt (or other CMake related file) is modified is disruptive because typically the panel will take up about 1/3rd of the screen space, causing other tabs to resize significantly.

Is there any way to stop this from happening?


Solution

  • Using the command palette, open your User Settings or Workspace Settings, as either the UI or the JSON file.

    enter image description here

    Then set these options to false:

    enter image description here

    {
        ...
        "cmake.configureOnEdit": false,
        "cmake.configureOnOpen": false,
        ...
    }
    

    This has not worked reliably in the past, but they worked on it and it hasn't caused me trouble since.