Home > Software design >  Is there a way to access VSCode workspace from desktop shortcut?
Is there a way to access VSCode workspace from desktop shortcut?

Time:03-01

I have a very basic setup such as a Raspberry Pi set up as a local web development server which I access with SSH keys (passphrase is configured automatically with SSH Agent service) and this is where I store my project. Now I have a certain Workspace there with some custom configurations and other settings.

I have tried to search in Google to quick access it, but found no way so far. In short, I would like to access this workspace with a desktop shortcut on the windows, which will open this workspace for me in VS Code, so I do not need to open VS Code and access this workspace manually.

Is there a way to access VSCode workspace from desktop shortcut?

Any help is very welcome!

CodePudding user response:

You can use the --folder-uri argument to code to open an SSH workspace folder:

--folder-uri vscode-remote://ssh-remote <your-hostname><your-folder>

E.g. if the hostname of your Raspberry Pi is rpi and your workspace is located in /home/myuser/workspace, open VS Code like like follows:

code --folder-uri vscode-remote://ssh-remote rpi/home/myuser/workspace

If code is in your PATH, using this line as target for your desktop shortcut should do the trick.

Alternatively, to have the VS Code icon on your shortcut, use the complete path to your code.exe, e.g.:

"C:\Users\myuser\AppData\Local\Programs\Microsoft VS Code\Code.exe" --folder-uri vscode-remote://ssh-remote rpi/home/myuser/workspace
  • Related