Article
· Dec 21, 2023 2m read

How to run ObjectScript commands in the VS Code integrated terminal

Have you ever been editing files in VS Code, but needed to check a global value or run a few ObjectScript commands? Now you can, with no setup required! If you have vscode-objectscript extension version 2.10.0 or later and are connected to InterSystems IRIS 2023.2 or later, you can now open a terminal connection to your server, regardless of where it's located.

There are three ways to open this new terminal:

  • The "Launch WebSocket Terminal" command in the command palette (Ctrl-Shift-P on Windows, Cmd-Shift-P on Mac):
    Launch WebSocket Terminal command

  • The VS Code integrated terminal's Profiles menu:
    terminal profiles menu

  • The Server Manager extension's server tree:
    server manager tree

The WebSocket Terminal supports many of the features of the standard ObjectScript shell like reads, namespace switches, interrupts and custom terminal prompts. However, in this post I'd like to highlight three features that are unique to it.

  • Command input is syntax colored, so you can be sure that your input is syntactically correct before running:
    syntax colored input

  • The terminal supports a multi-line editing mode, where a new line will be added upon pressing Enter instead of running the input. A new line will be added if there are unclosed left brace { or left parenthesis ( in the command input:
    multi-line input

  • It's fully integrated with VS Code's shell integration, so VS Code captures command input and output. This allows you to easily re-run commands and copy command output to the clipboard without having to highlight text with your cursor:
    command output

For a full list of features, see the official documentation. Have an idea for how we can improve this feature? We're happy to hear it! Post your suggestions on the extension's GitHub repository. All screenshots in this post use the new "InterSystems Default Dark Modern" VS Code theme, which is available in the InterSystems Language Server extension version 2.4.0 and later.

Discussion (3)3
Log in or sign up to continue