Open a file from command line in a particular VS Code window or workspace?

23 Views Asked by At

Is there a way to open a file from the command line in a particular vscode-remote window or workspace? I know code has --reuse-window or --new-window, but I would like to open the file in a specific workspace (I usually have 3+ remote workspaces open).

1

There are 1 best solutions below

0
starball On

As far as I know, no. Not at the time of this writing. At least on Linux, it seems to pick whichever window last had focus (and has issues if no workspace is open yet in any of them).

Technically you could use an integrated terminal in whichever terminal you wanted the file to be opened into, but I don't know if that counts for what you want.

Feel free to raise a feature-request issue ticket, but I have no idea how this would work and be user-friendly (how do you specify which window?). If you do, be prepared to do some carry work.