I use VSCode on a cloud VM. My workflow is to:
- Start the cloud VM from the terminal locally
- Wait for the VM to be ready
- Start VSCode
- Connect to the cloud VM through the SSH extension of VSCode
Steps 1 and 2 are pretty straightforward but I wish I could make it part of step 4. Is there a way to ask VSCode to run a certain command or script before ssh’ing to the remote VM?
I’ve searched online but haven’t come across any material on this topic. The nearest thing I’ve found was the postAttachCommand
for containers in How to make VSCode run custom script when attaching to a running remote container but I want a preAttachCommand
in SSH.