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": {
"path": "path/to/box"
}
- Close and save settings.json
Launch CommandBox from VSCode terminal
- Press
Cmd + Shift + PorCtrl + Shift + Pto launch the Command Palette - Begin typing
Terminal - When you see
Create New Terminal (With Profile)pressEnter - Under
Select the terminal profile to createyou should see theCommandBoxprofile 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”.
Thanks for pointing this out! I have updated the example.