Describe the Bug
I am experiencing an issue where my Docker Compose containers do not shut down automatically when I close a remote container session in Cursor. In VS Code, using the standard ms-vscode-remote.remote-containers extension, closing the editor window also shuts down the entire docker-compose stack as expected. In Cursor, with the Anysphere Dev Containers extension, the containers remain running in the background, requiring me to manually run docker-compose down to stop them.
This happens even when shutdownAction is explicitly set to stopCompose in the devcontainer.json file.
Steps to Reproduce
-
Create a project with a .devcontainer folder containing a devcontainer.json file and a docker-compose.yml file.
-
Configure the devcontainer.json to use the Docker Compose file and include “shutdownAction”: “stopCompose”.
-
Open the project folder in Cursor.
-
Use the command “Dev Containers: Reopen in Container” to launch the development environment.
-
Once the container is running and the editor is attached, close the Cursor window or use the “Close Remote Connection” command.
-
Check the status of the Docker containers in a terminal using docker ps.
Expected Behavior
When the Cursor window is closed or the remote connection is terminated, the Docker Compose services defined in the docker-compose.yml file should be stopped. The output of docker ps should show no running containers related to the project.
Operating System
Linux
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.2.2
VSCode Version: 1.99.3
Commit: faa03b17cce93e8a80b7d62d57f5eda6bb6ab9f0
Date: 2025-07-07T06:13:23.028Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Linux x64 6.14.0-23-generic
Additional Information
The Docker Compose services continue to run in the background after closing the Cursor window. I have to manually navigate to the project directory and run docker-compose down to stop them.
This functionality is critical for a smooth development workflow and proper resource management, as it prevents orphaned containers from consuming system resources. The behavior seems to be a regression from the standard functionality provided by the official VS Code extension. Thank you for looking into this!
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor