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

admin2025-04-16  5

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.

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?

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.

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?

Share Improve this question asked Feb 2 at 9:19 user2138149user2138149 17.7k30 gold badges149 silver badges296 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

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

Then set these options to false:

  • "Cmake: Configure On Edit" (cmake.configureOnEdit)
  • "Cmake: Configure On Open" (cmake.configureOnOpen)

{
    ...
    "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.

转载请注明原文地址:http://anycun.com/QandA/1744805776a87870.html