Skip to content

Commit beed319

Browse files
authored
outputToNewTerminal settings option (#126)
1 parent 8f85766 commit beed319

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@
288288
"default": "output",
289289
"description": "Where to print the output of tasks. Note that the output panel does not support ANSI colors."
290290
},
291+
"outputToNewTerminal": {
292+
"type": "boolean",
293+
"default": false,
294+
"description": "When using outputTo=terminal whether to use a new Terminal instance or reuse the last instance."
295+
},
291296
"checkForUpdates": {
292297
"type": "boolean",
293298
"default": true,
@@ -354,4 +359,4 @@
354359
"semver": "^7.5.0",
355360
"strip-ansi": "6.0.1"
356361
}
357-
}
362+
}

src/services/taskfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class TaskfileService {
225225
if (settings.outputTo === "terminal") {
226226
log.info(`Running task: "${taskName} ${cliArgs}" in: "${dir}"`);
227227
var terminal: vscode.Terminal;
228-
if (vscode.window.activeTerminal !== undefined) {
228+
if (vscode.window.activeTerminal !== undefined && settings.outputToNewTerminal === false) {
229229
terminal = vscode.window.activeTerminal;
230230
} else {
231231
terminal = vscode.window.createTerminal("Task");

src/utils/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Settings {
66
public updateOn!: string;
77
public path!: string;
88
public outputTo!: string;
9+
public outputToNewTerminal!: boolean;
910
public checkForUpdates!: boolean;
1011
public treeNesting!: boolean;
1112
public treeSort!: string;
@@ -29,6 +30,7 @@ class Settings {
2930
this.updateOn = config.get("updateOn") ?? "change";
3031
this.path = config.get("path") ?? "task";
3132
this.outputTo = config.get("outputTo") ?? "output";
33+
this.outputToNewTerminal = config.get("outputToNewTerminal") ?? false;
3234
this.checkForUpdates = config.get("checkForUpdates") ?? true;
3335
this.treeNesting = config.get("tree.nesting") ?? true;
3436
this.treeSort = config.get("tree.sort") ?? "default";

0 commit comments

Comments
 (0)