microsoft/vscode

reveal = Never/Silent not respected when running task programmatically

spmeesseman opened this issue · 3 comments

  • VSCode Version: 1.53
  • OS Version: Windows 10

Steps to Reproduce:

  1. Create an instance of Task
  2. Set instance.presentationOptions.reveal = TaskRevealKind.Never (or TaskRevealKind.Silent)
  3. Call vscode.tasks.executeTask()

Does this issue occur when all extensions are disabled?: Yes

Looks like same issue as #66749 back again?

Expected Behavior: No terminal should open
Actual Behavior: Terminal opens no matter what

Example:

private async run(task: Task)
{
    task.presentationOptions.reveal = TaskRevealKind.Never; // or TaskRevealKind.Silent
    try {
        await vscode.tasks.executeTask(task);
    }
    catch (e) {
}

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

I am not able to repro this issue. My test code:

	const disposable = vscode.commands.registerCommand('extension.helloWorld', () => {
		const task = new vscode.Task(
			{ type: 'shell' }, vscode.workspace.workspaceFolders![0], 'myTask',
			'myExt', new vscode.ShellExecution('dir'));
		task.presentationOptions.reveal = vscode.TaskRevealKind.Silent;
		vscode.tasks.executeTask(task);
	});

I also tested with TaskRevealKind.Never. The terminal is not shown.