1

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:

  1. (setup) Open New VS Code Window, Connect to Host... (Remote-SSH)
  2. New remote VS Code Window (SSH: hostname), Attach to Running Container... (Dev Containers)
  3. New remote container VS Code Window (Container <image_id>), Open Folder (<workdir>)
  4. 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.

1 Answer 1

2

This is not supported by the current CLI implementation.

I have submitted a feature request via the vscode GitHub repository, which has been accepted as a candidate for the backlog. If you agree that this could be a useful feature, upvote (+1/"👍") the issue description on GitHub to help promote it to the backlog so it can be implemented.

Link to GitHub feature-request issue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.