Reference
Last updated on 2026-08-27 | Edit this page
VS Code Keyboard Shortcuts
Essential Shortcuts for Remote Development
| Action | Windows/Linux | macOS |
|---|---|---|
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Quick Open (find file) | Ctrl+P | Cmd+P |
| Save file | Ctrl+S | Cmd+S |
| Toggle Sidebar | Ctrl+B | Cmd+B |
| Toggle Terminal | Ctrl+| Cmd+
|
|
| Open terminal | Ctrl+Shift+| Cmd+Shift+
|
|
| Split editor | Ctrl+\ | Cmd+\ |
| New terminal | Ctrl+Shift+| Cmd+Shift+
|
|
| Go to line | Ctrl+G | Ctrl+G |
| Find | Ctrl+F | Cmd+F |
| Find in files | Ctrl+Shift+F | Cmd+Shift+F |
| Find and replace | Ctrl+H | Cmd+H |
Remote-SSH Configuration
SSH Config Syntax
Located at ~/.ssh/config on your local machine:
Host sagehen
HostName sagehen.hpc.pomona.edu
User your_username
IdentityFile ~/.ssh/id_sagehen
ServerAliveInterval 300
ServerAliveCountMax 2
Key options: - Host - Alias you use in VS Code - HostName - Full cluster domain - User - Your Pomona username - IdentityFile - Path to your SSH private key - ServerAliveInterval - Keep connection alive (300 = 5 minutes) - ServerAliveCountMax - Max missed pings before disconnect (2)
Connecting to Sagehen HPC from VS Code
- Click the Remote Explorer icon (left sidebar)
- Select “SSH Targets” from dropdown (if not already selected)
- Find “sagehen” in the list
- Click the connect icon (or right-click → Connect to Host)
- When prompted, choose “Linux” as the platform
- Wait for VS Code to initialize remote connection
- A new window opens connected to Sagehen
VS Code Extensions for HPC Work
Recommended Extensions
| Extension | Publisher | Purpose |
|---|---|---|
| Remote - SSH | Microsoft | Connect to remote servers |
| Python | Microsoft | Python development, debugging, linting |
| Pylance | Microsoft | Advanced Python intelligence |
| Git Graph | mhutchie | Visualize Git history |
| Better Comments | Aaron Bond | Color-code comments |
| Trailing Spaces | Sharla Grayson | Highlight trailing whitespace |
| SLURM Helper | (if available) | SLURM syntax highlighting |
Installing Extensions
On remote system: 1. Open Remote Explorer (Ctrl+Shift+P → “Remote Explorer”) 2. Click Extensions icon in left sidebar 3. Search for extension name 4. Install directly - it installs on Sagehen automatically
On local system: - Same process, but extensions install locally (for local use)
Recommended Settings for HPC
Edit settings (Ctrl+, or Code → Settings):
JSON
{
"editor.fontSize": 13,
"editor.formatOnSave": false,
"editor.autoSave": "afterDelay",
"editor.autoSaveDelay": 2000,
"editor.rulers": [79, 120],
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"terminal.integrated.fontSize": 12,
"terminal.integrated.scrollback": 5000,
"[python]": {
"editor.defaultFormatter": "ms-python.python",
"editor.formatOnSave": true
},
"remote.SSH.showLoginTerminal": true,
"remote.SSH.useLocalServer": false
}
Key settings for HPC: - autoSave - Save regularly without asking - rulers - Vertical guides at 79/120 chars (PEP8 standards) - terminal.scrollback - Keep more terminal history - showLoginTerminal - Show authentication prompts (critical!)
Common VS Code Remote-SSH Tasks
Opening a Folder on Sagehen HPC
- Click File → Open Folder (Remote)
- Type the path:
/rhome/<myusername>/myproject - Click “OK”
- VS Code opens the folder
Editing Files on Sagehen HPC
Once connected: - File Explorer (Ctrl+Shift+E) shows remote file tree - Click files to open and edit them - Changes sync in real-time - File icons show status (white = unsaved)
Sagehen-Specific Information
File Paths on Sagehen HPC
BASH
/rhome/<myusername> # Your home directory (100GB, backed up)
/bigdata/lab/<labname> # Lab storage (1TB shared, backed up)
/scratch/your_username # Fast temporary (SSD, not backed up)
/tmpfs # RAM-based temp (ultra-fast, not backed up)
For this workshop, edit files in
/rhome/<myusername>.
Module System (Lmod)
Load software tools in terminal:
BASH
# View available modules
module avail
module avail python
module avail gcc
# Load modules
module load miniconda3
# gcc is available system-wide on Sagehen -- no module load needed
module load openmpi
# See what's loaded
module list
# Unload
module unload gcc
module purge # Remove all
# Save/restore environments
module save myenv
module restore myenv
Sample SBATCH Script
Create a file my_job.sbatch:
BASH
#!/bin/bash
#SBATCH --job-name=analysis
#SBATCH --output=logs/job_%j.log
#SBATCH --time=01:00:00
#SBATCH --cpus-per-task=4
#SBATCH --mem=8G
#SBATCH --partition=amd
module load miniconda3
python my_analysis.py --input data.csv
Submit with: sbatch my_job.sbatch
Troubleshooting Connection Issues
General Troubleshooting Steps
-
Verify local SSH works first:
-
Check VS Code output:
- View → Output
- Select “Remote-SSH” from dropdown
- Look for error messages
-
Try reconnecting:
- Click Remote indicator (bottom-left)
- Select “Close Remote Connection”
- Reconnect
-
Restart VS Code:
- File → Exit
- Reopen VS Code
- Reconnect
Common Issues and Solutions
| Issue | Cause | Solution |
|---|---|---|
| “Could not establish connection” | SSH config or network issue | Verify ssh sagehen works in terminal |
| “Authentication failed” | Wrong password or expired DUO code | Check caps lock, try new DUO code |
| “Permission denied (publickey)” | SSH key problem | Try password-only auth, check key permissions |
| “Operation timed out” | Network/firewall blocking | Check WiFi, try USB tether, contact IT |
| “VS Code hangs at login” | Remote-SSH not showing terminal | Enable remote.SSH.showLoginTerminal in settings |
| “Terminal commands not found” | Modules not loaded | Run module load miniconda3 in terminal |
Debug Information to Collect
If contacting HPC support:
- Error message - Copy the exact text from VS Code Output panel
- Your setup - OS, VS Code version, Remote-SSH version
-
What works - Can you
ssh sagehenfrom terminal? - Steps taken - What have you already tried?
Contact: its-hpc@pomona.edu
File Transfer Between Local and Sagehen HPC
Python Development on Sagehen HPC
Selecting Python Interpreter
- Open Command Palette (Ctrl+Shift+P)
- Type “Python: Select Interpreter”
- Choose from available environments
- Or choose “Enter interpreter path…” for custom
Resources and Support
Documentation
- VS Code Remote-SSH: https://code.visualstudio.com/docs/remote/ssh
- VS Code Settings: https://code.visualstudio.com/docs/getstarted/settings
- SLURM Manual: https://slurm.schedmd.com/sbatch.html
- Sagehen Cluster: https://pomona-college.github.io/
Getting Help
- Email: its-hpc@pomona.edu
- Instructor: Andrew Wilson
- OnDemand: https://ondemand.hpc.pomona.edu/ (web interface alternative)
Tips for Productive HPC Workflow
- Use terminal in VS Code - Stays in your project folder
- Keep files on Sagehen - Avoid syncing large files locally
- Test scripts locally first - Easier debugging on your machine
- Use SLURM for real work - Terminal is for testing
-
Monitor jobs frequently - Catch errors early with
squeue -
Save logs - Use
#SBATCH --outputto capture job output -
Backup important files - Use
/rhome(backed up) not/scratch