Skip to content

Warning

This is as a Lab Notebook which describes how to solve a specific problem at a specific time. Please keep this in mind as you read and use the content. Please pay close attention to the date, version information and other details.

Setting up a terminal with VS Code to connect to the HPCC

Problem

Your local VS Code terminal shows "command not found" when you try to load modules after connecting to the HPCC.

Cause

VS Code is not initializing a login shell to load /etc/profile, which sets up command links to the module system.

Solutions

1) Temporary: run source /etc/profile in the VS Code terminal every time you log in.

2) Permanent:

  • Access your VS Code Settings
  • Search for terminal linux
  • Under Terminal › Integrated › Profiles: Linux click on Edit in settings.json Visual studio code settings page. The search bar shows "terminal linux". The text "Edit in settings.json" is circled.
  • Add the line "args": ["--login"] to the bash terminal entry. The result should look like
1
2
3
4
5
"bash": {
            "path": "bash",
            "icon": "terminal-bash",
            "args": ["--login"]
        },
  • Save the file. Back in the Settings tab, under Terminal › Integrated › Default Profile: Linux click on the drop down menu and select bash. Visual studio code settings page. The default terminal is set to bash.
  • Now when you connect to the HPCC, your terminal should have access to all commands as normal.