diff --git a/docs/editor/integrated-terminal.md b/docs/editor/integrated-terminal.md index 30b0ef549a..1e8e0def61 100644 --- a/docs/editor/integrated-terminal.md +++ b/docs/editor/integrated-terminal.md @@ -312,6 +312,80 @@ If no text is selected in the active editor, the line that the cursor is on is r >**Tip:** Also run the active file using the command `workbench.action.terminal.runActiveFile`. +## Automating launching of terminals + +The [Tasks](/docs/editor/tasks.md) feature can be used to automate the launching of terminals, for example the following `.vscode/tasks.json` file will launch a Command Prompt and PowerShell terminal in a single terminal group when the window starts: + +```json +{ + "version": "2.0.0", + "presentation": { + "echo": false, + "reveal": "always", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true + }, + "tasks": [ + { + "label": "Create terminals", + "dependsOn": [ + "First", + "Second" + ], + // Mark as the default build task so cmd/ctrl+shift+b will create them + "group": { + "kind": "build", + "isDefault": true + }, + // Try start the task on folder open + "runOptions": { + "runOn": "folderOpen" + } + }, + { + // The name that shows up in terminal tab + "label": "First", + // The task will launch a shell + "type": "shell", + "command": "", + // Set the shell type + "options": { + "shell": { + "executable": "cmd.exe", + "args": [] + } + }, + // Mark as a background task to avoid the spinner animation on the terminal tab + "isBackground": true, + "problemMatcher": [], + // Create the tasks in a terminal group + "presentation": { + "group": "my-group" + } + }, + { + "label": "Second", + "type": "shell", + "command": "", + "options": { + "shell": { + "executable": "pwsh.exe", + "args": [] + } + }, + "isBackground": true, + "problemMatcher": [], + "presentation": { + "group": "my-group" + } + } + ] +} +``` + +This file could be committed to the repository to share it with other developers or alternatively created as a user task via the `workbench.action.tasks.openUserTasks` command. + ## Next steps The basics of the terminal have been covered in this document, read on to find out more about: