I've got 2 flavors of launching VS Code on remote servers for you
-
Clean terminal, you know you want to launch code on a remote server. Check out
sshcode.sh -
You want to launch code on your local machine from inside an existing SSH session. This needs a bit of setup, but seems to work pretty well. Hacks inbound!
- Set
PermitLocalCommand yesin your SSH config (see example) - Add a
LocalCommandto stash the username, IP, and current directory in a local file when you connect - Save
hack.shin your home directory
Now to connect, use the SSH escape sequence (default single tilde ~) along with !command to invoke the script
- Press
Enter - Press
~ - Type
!command ~/hack.sh - ???
- Congrats, you've just launched VS Code from an existing SSH session with only nominal pain. Impress your friends!