Here is a helpful workspace configuration option(s) that allows you to set the default terminal profile (terminal.integrated.defaultProfile.YOUR_OS) to CommandBox in VSCode terminal. This allows you to launch CommandBox by default when you open a terminal in the workspace. Further, you can specify the current working directory (terminal.integrated.cwd) so any new terminal you open in the workspace will start in that directory.
On OSX
"settings": {
"terminal.integrated.profiles.osx": {
"CommandBox": {
"path": "/Users/csimmons/.CommandBox/bin/box"
}
},
"terminal.integrated.defaultProfile.osx": "CommandBox",
"terminal.integrated.cwd": "/Users/csimmons/websites/demos"
}
On Windows
"settings": {
"terminal.integrated.profiles.windows": {
"CommandBox": {
"path": "C:\\Users\\csimmons\\.CommandBox\\box.exe"
}
},
"terminal.integrated.defaultProfile.windows": "CommandBox",
"terminal.integrated.cwd": "C:\\Users\\csimmons\\websites\\demos"
}
Note(s)
- These settings are stored in YOUR_WORKSPACE.code-workspace so you can set them on a per workspace basis.
- YOUR_OS = the OS you are running
- YOUR_WORKSPACE = whatever the .workspace file is for your current workspace.
This post is a follow up to a topic I originally posted titled Run CommandBox directly inside VSCode Terminal which explained setting up a custom terminal profile (terminal.integrated.profiles.YOUR_OS) for CommandBox.
Nice tip, thanks for sharing!