I am familiar with devcontainers in VSCode so I want to use them in cursor too. Unfortunately I cannot get cursor to recognise my devcontainer configuration.
Steps to Reproduce
I have manually added file ./.devcontainer/devcontainer.json to my repo. I have installed the dev containers extension (anysphere.remote-containers version 1.0.12).
Expected Behavior
I was expecting that cursor would recognise my devcontainer.json file and ask me if I wanted to open the repository in a devcontainer. This has not happened.
I clicked on the “Open a remote window” icon in the very bottom-left of the cursor window and I see the options that you can see in the “Screenshots / Screen recordings” below. I select “Open folder in Container” and it opens the Mac open dialog asking me to navigate to and choose a folder, this is not what I want. I want cursor to recognise my devcontainer.json and build a devcontainer from it.
Note that everything seems to work fine in VSCode. I opened the folder in VSCode and it immediately prompted me to ask if I wanted to open in a devcontainer. I chose yes, it built the devcontainer and its working.
The file should be in a folder called .devcontainer, not ./devcontainer.
That said, the Cursor team has completely broken devcontainer support in the last few days. They blocked the microsoft dev container extension, and replaced it with their own broken half-baked attempt, which doesn’t even allow my devcontainers to open any more.
Hi @jamiekt, thank you for this feedback. Could you try updating to version 1.0.13 of the Anysphere Remote Containers extension? We added a prompt to “Reopen in Container” when we detect a devcontainers.json file is present.
For reference, you can also reopen a folder in a container through the command palette:
Thank you @ravirahman . The extension seems to have updated itself and I’m now running 1.0.13. This time upon opening the repo it detected devcontainer.json and I was prompted to open in the devcontainer.
One question though. It opened a new cursor window for the devcontainer therefore I now have two cursor windows for the same repo, one using the devcontainer and one not. Is this intentional?
Yes; you can close the original after the new window opens. We’ve found it’s helpful to keep the original window open – especially when working on the devcontainer.json file.
Just some feedback… I’m finding this behaviour of opening the devcontainer in a new Cursor instance very irritating. Each time I do so I have to switch back to the previous instance to close it down. If you could provide an option to open the devcontainer in the same instance it would be appreciated.