Assuming there is an actively running container on the remote host.
Here is the GUI process I'd like to replicate with a single CLI command:
- (setup) Open New VS Code Window, Connect to Host... (Remote-SSH)
- New remote VS Code Window (
SSH: hostname), Attach to Running Container... (Dev Containers) - New remote container VS Code Window (
Container <image_id>), Open Folder (<workdir>) - Done
At the start of step 2, whilst connecting with the remote container, you can view the log. The first line of that log reads;
Dev Containers 0.397.0 over Remote - SSH 0.117.1 in VS Code 1.97.2 (e54c774e0add60467559eb0d1e229c6452cf8447)
This is what the CLI code command in question should do.
Step 0 (setup) can be done using the following CLI code command:
code --folder-uri="vscode-remote://ssh-remote+<hostname>/<workdir>"
Locally, Step 1 can be done using the following CLI code command (i.e. run on the container host):
code --folder-uri="vscode-remote://attached-container+<hex_container_id_or_name>/<workdir>"
1st line of log; Dev Containers 0.397.0 in VS Code 1.97.2 (e54c774e0add60467559eb0d1e229c6452cf8447)
Therefore, one would expect that the desired CLI code command (to be run on the VS Code host) would be a close combination of these two commands.
Clearly this process should be possible (as the manual steps and log show). However, is it possible that this is not supported by the current CLI implementation?
I look forward to reading each and every response and the insight you have to share.