don't prompt if user explicitly set automatic tasks to off (#291671)

This commit is contained in:
Megan Rogge
2026-01-29 13:32:56 -05:00
committed by GitHub
parent bf729fa50a
commit 424641585a
@@ -47,9 +47,9 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut
if (!this._workspaceTrustManagementService.isWorkspaceTrusted()) {
return;
}
const hasShownPromptForAutomaticTasks = this._storageService.getBoolean(HAS_PROMPTED_FOR_AUTOMATIC_TASKS, StorageScope.WORKSPACE, false);
if (this._hasRunTasks ||
(this._configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'off' && hasShownPromptForAutomaticTasks)) {
const { value, userValue } = this._configurationService.inspect<string>(ALLOW_AUTOMATIC_TASKS);
// If user explicitly set it to 'off', don't run or prompt
if (this._hasRunTasks || (value === 'off' && userValue !== undefined)) {
return;
}
this._hasRunTasks = true;