Skip to content

Commit fd5d3ca

Browse files
authored
Update behavior of task reveal === silent (microsoft#61477)
When task reveal is set to silent, only show the terminal if the exit code is not 0 or if there are poblem matches Fixes microsoft#41671
1 parent d00ae9b commit fd5d3ca

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ export class TerminalTaskSystem implements ITaskSystem {
339339
this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Inactive, task));
340340
if (eventCounter === 0) {
341341
let reveal = task.command.presentation.reveal;
342-
if (reveal === RevealKind.Silent && watchingProblemMatcher.numberOfMatches > 0 && watchingProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error) {
342+
if ((reveal === RevealKind.Silent) && (watchingProblemMatcher.numberOfMatches > 0) && (watchingProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error)) {
343343
this.terminalService.setActiveInstance(terminal);
344344
this.terminalService.showPanel(false);
345345
}
@@ -388,7 +388,7 @@ export class TerminalTaskSystem implements ITaskSystem {
388388
break;
389389
}
390390
let reveal = task.command.presentation.reveal;
391-
if (reveal === RevealKind.Silent && (exitCode !== 0 || watchingProblemMatcher.numberOfMatches > 0 && watchingProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error)) {
391+
if ((reveal === RevealKind.Silent) && ((exitCode !== 0) || (watchingProblemMatcher.numberOfMatches > 0) && (watchingProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error))) {
392392
this.terminalService.setActiveInstance(terminal);
393393
this.terminalService.showPanel(false);
394394
}
@@ -450,7 +450,7 @@ export class TerminalTaskSystem implements ITaskSystem {
450450
break;
451451
}
452452
let reveal = task.command.presentation.reveal;
453-
if (reveal === RevealKind.Silent && (exitCode !== 0 || startStopProblemMatcher.numberOfMatches > 0 && startStopProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error)) {
453+
if ((reveal === RevealKind.Silent) && ((exitCode !== 0) || (startStopProblemMatcher.numberOfMatches > 0) && (startStopProblemMatcher.maxMarkerSeverity >= MarkerSeverity.Error))) {
454454
this.terminalService.setActiveInstance(terminal);
455455
this.terminalService.showPanel(false);
456456
}
@@ -474,7 +474,7 @@ export class TerminalTaskSystem implements ITaskSystem {
474474
if (!terminal) {
475475
return TPromise.wrapError<ITaskSummary>(new Error(`Failed to create terminal for task ${task._label}`));
476476
}
477-
if (task.command.presentation.reveal === RevealKind.Always || (task.command.presentation.reveal === RevealKind.Silent && task.problemMatchers.length === 0)) {
477+
if (task.command.presentation.reveal === RevealKind.Always) {
478478
this.terminalService.setActiveInstance(terminal);
479479
this.terminalService.showPanel(task.command.presentation.focus);
480480
}

0 commit comments

Comments
 (0)