Initially I looked at the CommandBox documentation for running it inside VSCode: https://commandbox.ortusbooks.com/ide-integrations/visual-studio-code. However, the Shell Launcher extension was deprecated in favor of Terminal Profiles in the Integrated Terminal (VSCode >= v1.55). See this article: https://code.visualstudio.com/updates/v1_55#_terminal-profiles.
Set up a Terminal Profile for CommandBox:
- Open VSCode
Preferences > Settings
- Search for
terminal.integrated.profiles.osx
(Replace osx with windows or linux based on your os) - Click “edit in settings.json”
- Add the following under
terminal.integrated.profiles.osx
"CommandBox": { "source": "path/to/box" }
- Close and save settings.json
Launch CommandBox from VSCode terminal
- Press
Cmd + Shift + P
orCtrl + Shift + P
to launch the Command Palette - Begin typing
Terminal
- When you see
Create New Terminal (With Profile)
pressEnter
- Under
Select the terminal profile to create
you should see theCommandBox
profile you created. Select it with the down arrow key and pressEnter
- CommandBox should launch in the terminal window
Thanks for this tip! Note that the current implementation appears to use “path” rather than “source”.