- Visual Studio Code is installed on your local machine
- WUSTL microsoft account login information
- Basic understanding of how to navigate VSCode GUI
- Press Mac:
CMD+SHIFT+Por Windows:CTRL+SHIFT+Pto open the Command Palette
- Press Mac:
- Ability to execute bash commands in the integrated terminal
- Windows users will need to install git for Windows, then set the default shell in VSCode to Bash.
- In the Command Palette, type
Terminal: Select Default Profileand select the command from the dropdown menu. - A list of detected shells will appear at the top of the screen. Select Git Bash from the list.
- In the Command Palette, type
a. On your local machine, open Visual Studio Code.
b. Open the Command Palette.
c. Type shell command to find the Shell Command: Install 'code' command in PATH command.
d. After executing the command, restart the terminal for the new $PATH value to take effect.
e. verify setup by typing code --version in the terminal.
If it prints out the version of Visual Studio Code, proceed.
Now when you are using a terminal, you can simply type code . to start editing files in the current folder.
You can also add an option -r and provide the path to a file. This will open the file in a new tab in the current window: code -r <filename>.
- Open VSCode on your local machine
- Go to Extensions
(Shortcut: Cmd+Shift+X) - Search and install the following extensions:
ms-python.python- Python language supportms-toolsai.jupyter- run Jupyter notebooksms-toolsai.datawrangler- view data interactively within VSCodems-vscode-remote.vscode-remote-extensionpack- for ssh and tunneling to connect to and use IDE features on the serverms-vscode.remote-explorer- see remotes to connect toGitHub.remotehub- navigate github repos without needing to clonems-vscode.remote-repositories- view and edit remote repositoriesGitHub.copilotGitHub.copilot-chat
A button will appear on some extensions giving you the option to also install on the remote machine. This will install the extension to your home folder on HTCF.
You can list all installed extensions with their versions by running code --list-extensions --show-versions.
While still on your local machine:
a. Enter the following at the terminal prompt to create the ssh config file and folder if they do not already exist:
mkdir -p ~/.ssh && chmod 700 ~/.ssh
[ ! -f ~/.ssh/config ] && touch ~/.ssh/config && chmod 600 ~/.ssh/config
b. Press CMD + SHIFT + P to open the Command Palette. Begin typing and select Remote-SSH: Open SSH Configuration File. Open the configuration file in your home directory.
c. Paste the following in ~/.ssh/config, substituting your username. Save and close the file.
Host htcf
Hostname login.htcf.wustl.edu
User yourusername # change this
ControlMaster auto
ControlPath ~/.ssh/control:%h:%p:%r
d. Confirm that you are able to login after entering ssh htcf at the terminal prompt.
Note: Now to login you can select the "Open a remote window" button in the bottom-left corner of the window.
Select Connect to a Host and click htcf.
By setting up SSH keys you won't have to enter your credentials every time you log on to HTCF.
Enter the following at the prompt of a local terminal:
ssh-keygen -t ed25519
chmod 400 ~/.ssh/id_ed25519
export PUBKEYPATH="$HOME/.ssh/id_ed25519.pub"
With your username:
export USER_AT_HOST="[email protected]"
ssh-copy-id -i "$PUBKEYPATH" "$USER_AT_HOST"