Skip to content

Commit

Permalink
outputToNewTerminal settings option (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoiang authored Apr 5, 2024
1 parent 8f85766 commit beed319
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@
"default": "output",
"description": "Where to print the output of tasks. Note that the output panel does not support ANSI colors."
},
"outputToNewTerminal": {
"type": "boolean",
"default": false,
"description": "When using outputTo=terminal whether to use a new Terminal instance or reuse the last instance."
},
"checkForUpdates": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -354,4 +359,4 @@
"semver": "^7.5.0",
"strip-ansi": "6.0.1"
}
}
}
2 changes: 1 addition & 1 deletion src/services/taskfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class TaskfileService {
if (settings.outputTo === "terminal") {
log.info(`Running task: "${taskName} ${cliArgs}" in: "${dir}"`);
var terminal: vscode.Terminal;
if (vscode.window.activeTerminal !== undefined) {
if (vscode.window.activeTerminal !== undefined && settings.outputToNewTerminal === false) {
terminal = vscode.window.activeTerminal;
} else {
terminal = vscode.window.createTerminal("Task");
Expand Down
2 changes: 2 additions & 0 deletions src/utils/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Settings {
public updateOn!: string;
public path!: string;
public outputTo!: string;
public outputToNewTerminal!: boolean;
public checkForUpdates!: boolean;
public treeNesting!: boolean;
public treeSort!: string;
Expand All @@ -29,6 +30,7 @@ class Settings {
this.updateOn = config.get("updateOn") ?? "change";
this.path = config.get("path") ?? "task";
this.outputTo = config.get("outputTo") ?? "output";
this.outputToNewTerminal = config.get("outputToNewTerminal") ?? false;
this.checkForUpdates = config.get("checkForUpdates") ?? true;
this.treeNesting = config.get("tree.nesting") ?? true;
this.treeSort = config.get("tree.sort") ?? "default";
Expand Down

0 comments on commit beed319

Please sign in to comment.