I am using a dev container to develop my c++ project on a microcontroller. The have my entire toolchain in a docker-compose / dockerfile, which autorestarts.
I have to follow these steps every time:
A second vscode will open, which connects to the docker container.
I always start vscode from a terminal:
code .Is there a way to make vscode remember that I always want to connect to my dev container when vscode is openened in that specific repo?
I am reading stuff on devcontainer.json, but I can't figure out how to define it so that i just opens an already existing container.

You can use devcontainer CLI to open the devcontainer directly. I found the solution here: bh231's answer
You can install it directly in VS Code and then you need to add the devcontainer CLI path to your $PATH variable. After terminal restart you can go to your repo folder (as you did before) but then you need to call devcontainer open which will open your devcontainer directly from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With