Can VSCode IDE do this? Execute a command such as running a batch file or powershell script automatically when a new Integrated Terminal is opened?
Can VSCode IDE do this? Execute a command such as running a batch file or powershell script automatically when a new Integrated Terminal is opened?
The previous answer was deprecated although it will still work but with a warning. The new way to do it in VS Code is to add this section to your settings.json. Here I configured my PowerShell to automatically import a module posh-git that prettifies my command prompt for git. :)
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": [
"-NoExit", "-Command", "Import-Module posh-git"
]
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
}
}