Question
· Jan 22, 2022

How to set up VSCode terminal for IRIS terminal?

Hi there,

Please, could anyone tell me how can I set up VSCode terminal to IRIS terminal? I already saw this working in a video with docker version from IRIS Community. I have the Intersystems Extension Pack and IRIS Community locally installed.

 

Thanks

Product version: IRIS 2021.1
$ZV: 2021.1 (Build 215.3U)
Discussion (12)3
Log in or sign up to continue

I don't use Windows, but can say how it supposed to be

VSCode supports PowerShell terminal or cmd.exe, in case if you use wsl2, it can bee configured to open it as well.

But, there is a way, to open the terminal just in cmd.exe or from PowerShell, first you have to figure it out how to get it from there. iris.exe should have options, to run it inside the current terminal, I don't know if Windows version already has irissession, you could try it.

To get an IRIS session integrated in VSCode terminal, you can add it to settings.json :

  "terminal.integrated.profiles.windows": {
        "IRIS Terminal": {
            "path": [
                "C:\\InterSystems\\IRISHealth\\bin\\irissession.exe"
            ],
            "args": ["<instance name>"],
            "icon": "terminal-cmd"
        }
    }

However, this terminal window will lack the niceties of the ISC Terminal application, such as command history.

For those that use a Windows workstation but code on a Linux/Unix-based server, here's a configuration that provides a remote IRIS terminal session. It uses the ssh client that is included with Windows 10 (I'm assuming there's one in Windows 11 as well).

Add it to your user settings to make it available across all of your projects, or to your workspace settings to have a custom terminal session per workspace:

    "terminal.integrated.profiles.windows": {
        "IRIS Session": {
            "overrideName": true,
            "path": "C:\\Windows\\System32\\OpenSSH\\ssh.exe",
            "args": [
                "-t",
                "<user>@<hostname>",
                "iris session <instance>"
            ]
        }
    }

One oddity I've noticed when using this method is that the Home/End keys don't work as expected.

If I start an ssh shell session and manually run iris session <instance>, everything works normally.

If I start it using the method described in my post above, the Home and End keys seem to send a newline or carriage return, sending what I've typed to the IRIS interpreter rather than moving the cursor to the beginning of the line. This is regardless of whether I execute it from VS Code or the "DOS" Shell, so it's not really a VS Code problem. Just curious if anyone else has a solution ...

Note: Interestingly Ctrl+A works for moving to the beginning of the line ... but not Home.