MSYS2 bash automation shell not working

When I configure Cursor to use the MSYS2 bash shell on my Windows 11 system, interactive shells work fine but automation shells inherit the Windows path and no MSYS2 paths (e.g. /usr/bin). This means almost no commands work.

Cursor’s AI figured out that it could run
export PATH=“/usr/bin:/mingw64/bin:$PATH”
to fix things but often forgets to.

Here’s my workspace settings.json, there are no terminal settings at user level:

{
    "terminal.integrated.profiles.windows": {
        "MSYS2 MINGW64": {
            "path": "c:\\devtools\\msys64\\usr\\bin\\bash.exe",
            "args": [
                "--login",
                "-i"
            ],
            "env": {
                "MSYSTEM": "MINGW64",
                "MSYS2_PATH_TYPE": "minimal",
                "CHERE_INVOKING": "1"
            }
        }
    },
    "terminal.integrated.defaultProfile.windows": "MSYS2 MINGW64",
    "terminal.integrated.automationProfile.windows": {
        "path": "c:\\devtools\\msys64\\usr\\bin\\bash.exe",
        "args": ["--login", "-i"],
        "env": {
            "MSYSTEM": "MINGW64",
            "MSYS2_PATH_TYPE": "inherit",
            "CHERE_INVOKING": "1",
            "PATH": "/usr/bin:/mingw64/bin:${env:PATH}"
        }
    }
}