There is a known bug effecting VSCode shell integration when using zsh on MacOS. To work around it set tab
shelltobashinterminal.config.json
Run sets of terminal commands in bulk. Quickly set up terminal tabs, run command flows, navigate directories, and more
- Open your workspace in VS Code.
- Create a
terminal.config.jsonfile at the root of your workspace. - Open the command palette (Ctrl/Cmd + Shift + P)
- Type
Auto Terminal: Actionand select an action
Start by defining terminal configurations, either:
- Create a
terminal.config.jsonfile at the root of your workspace - Select a template file:
- Open the command palette (Ctrl/Cmd + Shift + P)
- Select
Auto Terminal: Template
Example:
{
// action name
"setup": [
{
"tab": "frontend", // terminal tab name
"commands": ["cd Frontend", "npm i", "clear", "code app/page.tsx"], // array of commands
"header": "Frontend", // optional terminal header
"icon": "branch", // optional tab icon
"color": "pink", // optional icon color
},
{
"tab": "backend",
"commands": [
"cd Backend",
"source venv/bin/activate",
"pip install -r requirements.txt",
"clear"
],
"description": "Install requirements.txt"
}
],
// If `Run Open Commands On Startup` is enabled,
// open action will run on workspace launch
"open": [
{
"tab": "git",
"commands": ["git branch", "*alert remember to create a branch],
},
],
}
- Open the command palette
- Type
Auto Terminal: Templateand select a template option
- Open your User settings (Ctrl/Cmd+ ,)
- Search for
Auto Terminal: Custom Templates - Add a new key-value pair to the customTemplates object, where the key is the template name and the value is the template itself
"autoTerminal.customTemplates": {
"custom template name": {
"actionName": [
{
"tab": "",
"commands": [],
}
],
"actionName2": [
{
"tab": "",
"commands": [],
}
]
}
}- The custom template will now appear as an option when running command
Auto Terminal: Template
When the Auto Terminal: Run Open Commands On Startup setting is enabled any commands specified inside the open action in your terminal.config.json file will be automatically executed when you open your workspace
When the Auto Terminal: Add Quick Run To Terminal setting is enabled a button to quickly run Auto Term: Action will be added to the terminal menu bar
- Open your workspace settings (
Code/File>Preferences>Settings) - Search for
Auto Terminal: Run Open Commands On StartuporAdd Quick Run To Terminal - Check the box to enable the setting
Helper commands that can be used to perform actions beyond standard command input. These always begin with *
| Command | Description | Usage |
|---|---|---|
| *stop | Stops a running process | "commands": ["*stop"] |
| *close | Closes the terminal | "commands": ["*close"] |
| *focus | Focus on the Terminal | "commands": ["*focus"] |
| *delay | Delays next command | "commands": ["*delay 1000"] |
| *alert | Creates a notification | "commands": ["*alert remember to open PR"] |
| *cd | Change directory if not already in it. Fails gracefully if the directory does not exist | "commands": ["*cd path/to/directory"] |
| *echo | Send text to terminal. | "commands": ["*echo remember to pull changes"] |
* there can only be 3 alert windows open at a time
