Suppress CMake output focus for automatic triggers with new setting#4989
Open
hanniavalera wants to merge 2 commits into
Open
Suppress CMake output focus for automatic triggers with new setting#4989hanniavalera wants to merge 2 commits into
hanniavalera wants to merge 2 commits into
Conversation
…gers (#4988) The CMake output channel was unconditionally revealed at the start of every build (cmakeProject.runBuild) and configure (cmakeProject.configureInternal). With the default cmake.revealLog=always this preserves keyboard focus but still switches the shared bottom panel from the user's Terminal to Output - disruptive when a build/configure is triggered automatically (configure-on-open, reconfigure) or programmatically (a build/test invoked through the CMake Tools API by the C/C++ DevTools companion on behalf of Copilot, which the user did not directly request). The reveal is entirely cmake-tools' responsibility - cmake-tools registers no Copilot/LM surface; the companion drives builds via the exported build()/buildWithResult()/ ctestWithResult() API, which had no way to suppress the reveal. Fix: classify each configure/build/test as user-initiated vs automatic/programmatic and only suppress the proactive start reveal for automatic ones, gated by a new opt-in setting cmake.revealLogOnAutomaticTrigger (default false, scope window). Explicit user-initiated operations keep today's cmake.revealLog behavior, and build/configure/test failures always surface regardless of the setting. - src/logging.ts: extract pure decideReveal() helper; showChannel() takes an isAutomatic flag and reads cmake.revealLogOnAutomaticTrigger. - src/cmakeProject.ts: add isAutomaticConfigureTrigger(); thread isAutomatic through runBuild/build/ctest; classify the configure-start reveal by ConfigureTrigger. - src/ctest.ts: thread isAutomatic into runCTest's reveal. - src/api.ts: mark build/buildWithResult/ctestWithResult as programmatic (isAutomatic=true). - package.json/package.nls.json/docs/cmake-settings.md/CHANGELOG.md: new setting. - test/unit-tests/backend/revealLog.test.ts: manifest guard + decideReveal and isAutomaticConfigureTrigger decision-matrix tests.
hanniavalera
added a commit
that referenced
this pull request
Jun 24, 2026
…en the build terminal promptly Two adjustments to the colorized build-output reveal work, in anticipation of the cmake.revealLogOnAutomaticTrigger PR (#4988 / #4989) merging first: Layer on #4988 instead of diverging from it: - Align logging.ts `decideReveal` and `Logger.showChannel` to the exact shape used by #4988 (`{ shouldShow, preserveFocus }`), so when that PR merges there is a single shared implementation rather than two competing ones. `revealLogDecision` remains the only colorization-specific addition: a thin wrapper that maps `decideReveal` to the `{ show, focus }` shape the colorized terminal reveal consumes. `isAutomaticConfigureTrigger`, the isAutomatic threading, the API marking, and the setting itself are unchanged and already match #4988. Updated the backend test to the aligned shape and added coverage for the revealLogDecision mapping. Open the CMake Build terminal promptly (bug fix): - Previously the colorized terminal was only created and revealed once the build actually started, which happens after the pre-build configure. With a fresh kit/preset (e.g. gcc) the first configure is slow, so the user was left looking at configuration progress with no terminal. Now the terminal is opened and revealed before the pre-build configure (showing a brief "Preparing build…"), gated on the same reveal decision so automatic/programmatic builds still stay quiet. Adds prepareForConfigure() to the build sink (terminal and the portability Output-channel sink).
hanniavalera
added a commit
that referenced
this pull request
Jun 24, 2026
…en the build terminal promptly Two adjustments to the colorized build-output reveal work, in anticipation of the cmake.revealLogOnAutomaticTrigger PR (#4988 / #4989) merging first: Layer on #4988 instead of diverging from it: - Align logging.ts `decideReveal` and `Logger.showChannel` to the exact shape used by #4988 (`{ shouldShow, preserveFocus }`), so when that PR merges there is a single shared implementation rather than two competing ones. `revealLogDecision` remains the only colorization-specific addition: a thin wrapper that maps `decideReveal` to the `{ show, focus }` shape the colorized terminal reveal consumes. `isAutomaticConfigureTrigger`, the isAutomatic threading, the API marking, and the setting itself are unchanged and already match #4988. Updated the backend test to the aligned shape and added coverage for the revealLogDecision mapping. Open the CMake Build terminal promptly (bug fix): - Previously the colorized terminal was only created and revealed once the build actually started, which happens after the pre-build configure. With a fresh kit/preset (e.g. gcc) the first configure is slow, so the user was left looking at configuration progress with no terminal. Now the terminal is opened and revealed before the pre-build configure (showing a brief "Preparing build…"), gated on the same reveal decision so automatic/programmatic builds still stay quiet. Adds prepareForConfigure() to the build sink (terminal and the portability Output-channel sink).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new setting to control the behavior of the CMake output channel during automatic or programmatic operations, such as configure-on-open or builds/tests triggered via the API (for example, by Copilot or other extensions). By default, the output channel will no longer take over the panel and hide your terminal during these operations, unless there is a failure. The previous behavior can be restored with the new setting. The implementation includes a refactor of the logic for revealing the output channel to make it more testable and configurable. Fixes #4988
The most important changes are:
User Experience Improvements:
cmake.revealLogOnAutomaticTrigger(default:false) that controls whether the CMake output channel is proactively revealed during automatic/programmatic configures, builds, or tests. When disabled, only failures are shown, and explicit user-initiated actions are unaffected. [1] [2] [3] [4]Core Logic and API Changes:
decideReveal, allowing for better testability and configurability.Logger.showChannelmethod and all relevant code paths inCMakeProjectandCTestDriverto use the new reveal logic and respect the new setting for automatic operations. [1] [2] [3] [4] [5] [6]Internal API and Type Changes:
isAutomaticConfigureTriggerto classify configure triggers as automatic or user-initiated, ensuring the new reveal logic is applied consistently.isAutomaticflag where needed for builds and tests.These changes improve the usability of the extension for users who rely on terminals during development, while still surfacing important information when failures occur.